Brendan Enrick

Daily Software Development

IIS 7 Not Serving Static Files

I learned this potentially very useful bit of information from Scott Forsyth recently. As you may know, IIS 7 is modular, which allows for a great deal of control and customization of an IIS installation. There are a lot of other great benefits also. Web servers are great tools that allow us to put our content on the web. One of the most powerful things is their support for creating dynamic sites through different programming frameworks and languages. We sometimes take for granted our having static content in our web server. The static content is all of the common content on a site, which is not dynamic. In general this means our htm, html, and image files.

If you’re ever not serving that content then you should make sure that your IIS installation is set up to serve that content using these steps.

Open up the control panel and click on the Programs category.

ControlPanel

Click on “Turn Windows features on or off” in the Programs and features section.

Programs

Expand in the tree view in this order: Internet Information Services, World Wide Web Services, Common HTTP Features. Then make sure that Static Content is checked.

WindowsFeatures

If that was unchecked and you checked it and clicked OK, then you should be all set and serving static files like images and html pages in your web site.

Not really sure why someone would want to turn that off, but at least it is easy to turn that setting back on.

Comments (1) -

  • John

    12/30/2011 7:56:19 PM | Reply

    Brilliant, Brendan, just brilliant! I spent a couple of hours hunting for a solution to this simple problem and was led down all sorts of winding and ultimately dead-end paths, before finding your very clear (thanks for the screenshots!) and 100% effective solution. Thanks a heap!

Loading