404 in ASP.NET MVC with Integrated Pipeline mode
- by David Martines
IIS 7.0 (Shared Hosting)
ASP.NET 2.0 Integrated Pipeline mode
MVC 1.0
I get a 404 on every url except /default.aspx.
I have this in my web.config:
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="Default.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="ScriptHandlerFactory_asmx" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactory_axd" verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResourceHandler" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="MvcHttpHandler" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ErrorLogPageFactory" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</handlers>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule" />
<remove name="UrlRoutingModule" />
<remove name="ErrorLog" />
<remove name="UnitOfWorkModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UnitOfWorkModule" type="MusicCompany.Infrastructure.UnitOfWorkModule, MusicCompany.Infrastructure" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
</modules>
The only unusual thing to me is the defaultDocument. It seems I need it because of the way the host (shared hosting) is set up (?)
Any clues?
Thanks