Getting 404 error on MVC web-site

This is quite often caused by the following missing from the web.config:

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/> 

Do you have a problem with just 1 page or the whole site is not working?

A) 1 page

  • You can use RouteDebugger to verify if the route is matched correctly

B) Whole site

  • I assume you're using Windows Server - check if ASP.NET is enabled in IIS - it's disabled by default, I believe.

  • You can use MvcDiagnostics page to check if all dlls are deployed properly.

  • Are you running in IIS7 integrated mode? Classic mode of IIS7 does not automatically map extensionless URLs to ASP.NET (much like IIS6)

  • Make sure your Web.config tag is configured correctly.


We finally nailed this issue by exporting the IIS configuration of a working server, and comparing it to ours.

It was a really obscure setting which had been changed from the default.

IIS ROOT → request Filtering → Filename Extensions Tab → Edit Feature Settings → Allow unlisted file name extensions

This should be ticked.

This can be set at the IIS level, or the site-level.

Screenshot of IIS showing location of Request Filtering option


Glad that fixed your problem. Others researching this issue should take note of the extensionless URL hotfix: http://support.microsoft.com/kb/980368