IIS 7 Not Serving Default Document

Viewed 32211

We have a problem occuring on some of our developer workstations: when visiting a URL without a filename (e.g. http://localhost/), IIS 7 returns a 404 error. Everyone is running Windows 7/IIS 7.5 and ASP.NET 4.0. The application pool is configured to use Classic pipeline mode.

Default documents are enabled, and default.aspx is in the default document list.

I enabled failed request tracing, and see this in the log:

OldHandlerName="", NewHandlerName="ExtensionlessUrl-ISAPI-4.0_64bit", 
  NewHandlerModules="IsapiModule", 
  NewHandlerScriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll", NewHandlerType=""

Later on, I see that this IsapiModule is rejecting the request:

ModuleName="IsapiModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="404",
  HttpReason="Not Found", HttpSubStatus="0", 
  ErrorCode="The operation completed successfully. (0x0)", ConfigExceptionInfo="" 

It looks like IIS thinks the ExtensionlessUrl-ISAPI-4.0-64bit should be handling the request. When I look at that module's configuration, it shows that it should be matching path *., so I'm confused why it is matching no path.

A Google search turns up this post on the IIS.net forums from 2005. Unfortunately, no solutions are offered, just an acknowledgement of the problem.

When I update my app pool to use integrated mode, the problem goes away. Unfortunately, it has to run in Classic mode.

What can I do to get IIS to server our default documents again?

6 Answers

I use the following rule in web.config URL Redirect as workaround to solve this:

 <system.webServer>
    <rewrite>
      <rules>
        <rule name="Default document rewrite" stopProcessing="true">
          <match url="^(.+/)?$" />
          <action type="Redirect" url="https://{HTTP_HOST}/default.aspx" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
Related