IIS 7 Not Serving Default Document

iis-7.5

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?

Best Answer

It looks like Microsoft released an update that enables the ExtensionlessURL HTTP handler to work with extensionless URLs. Unfortunately, this breaks certain other handlers. In my case, the DefaultDocument handler under classic app pools. The solution is to remove the ExtensionlessURL handlers in our application's web.config:

<system.webServer>
  <handlers>
    <remove name="ExtensionlessUrl-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrl-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrl-Integrated-4.0" />
  </handlers>
</system.webServer>
Related Topic