IIS 7.5 Default Document doesn’t work

Weird, I’m in Integrated mode running a .NET 4.0 application and the default document looks set but its not working. I get a 404 for the / page.

First I checked the web.config for the site and it looks fine:

<defaultDocument>
            <files>
                <clear />
                <add value="pictures.aspx" />
                <add value="default.aspx" />
                <add value="index.htm" />
                <add value="index.html" />
            </files>
        </defaultDocument>
  </system.webServer>

Next I look into the settings in IIS Manager and everything is fine there. The DefaultDocumentModule inherits from the server setting and it is enabled there.
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Everything looks fine but I keep getting 404.

Next I looked in the applicationHost.config file. A tough one to track down actually because it looks like even for 64 bit its hidden in the C:\Windows\System32\inetsrv\config folder. Rick talks about it here a bit

<sectionGroup name="system.webServer">
            <section name="asp" overrideModeDefault="Deny" />
            <section name="caching" overrideModeDefault="Allow" />
            <section name="cgi" overrideModeDefault="Deny" />
            <section name="defaultDocument" overrideModeDefault="Allow" />
            <section name="directoryBrowse" overrideModeDefault="Allow" />
            <section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
            <section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

Here’s the website application pool configuration that is being used by the website in IIS 7.5 running under Windows 2008 R2 SP1 x64.image
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

A few things in stackoverflow and the web but nothing really nails it that I can find. For now I wasted enough time. I’ll come back later.

~~~update

Just for kicks I fired up a new website and put a default.aspx file in it. It worked. Even after changing to v4.0. Let me delete the other one and recreated it and see how that goes.

~~~update

I’m sure it’s something in the web.config that messing it up now. I’ll have to triage it since it’s a big fellow right now.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to IIS 7.5 Default Document doesn’t work

  1. NinjaCross says:

    I’m experiencing the same problem, and nothing seems to change the situation.
    Did you manage to solve it ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s