Asp – Recieving 404 error for everything except homepage in ASP.NET MVC APP

asp.net-mvciis-6

I have what seems to be a strange problem to me. I am working on creating an ASP.NET MVC project and when I load the site using the 'Visual Studio Development Server', everything works as expected. However, if I change the project properties to 'use local IIS Web Server' and load the site, only the Home Page works. If I try to load any other page I get a 404 error. The application is running on Windows Server 2003 and IIS 6.

Any suggestions on how to fix this issue would be greatly appreciated.

Best Answer

Not strange at all. You need to setup IIS6 to route requests to the ASP.NET engine.

Steve Sanderson has a fine article discussing different options on deploying ASP.NET MVC to IIS 6.

He presents five alternative solutions - pick one:

  1. Use a wildcard mapping for aspnet_isapi.dll
  2. Put .aspx in all your route entries’ URL patterns
  3. Use a custom filename extension in all your URL patterns
  4. Use URL rewriting
  5. Upgrade to Windows Server 2008 and IIS 7