My mvc 2 application serves 404 for all pages except the home page


I have an mvc 2 application that is running in ii6 in the test environment and production server.

The test enviroment runs just fine, but after moving to production all pages except the home page server up 404 errors.

I have followed step 2, here: and added a .aspx extension to the route, and have tried the wildcard mapping. It doesn't appear to make any difference.

I put the diagnostic file found here: into the directory and loaded it, but it does not report any errors or problems.

I even wiped the test server and reinstalled the app from scractch, setup the wildcard mapping and it worked fine.

Right now the pages are being routed like: Home.aspx/About and my routing table looks like this:

public static void RegisterRoutes(RouteCollection routes)
    routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

        "Default", // Route name
        "{controller}.aspx/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        new { controller = "NewEmployee", action = "Index" }
        new { controller = "Admin", action = "Index" });
        new { controller = "AccessMaster", action = "Index", id=UrlParameter.Optional,subid=UrlParameter.Optional });

      new { controller = "Home", action = "Index", id = "" }


I'm at a loss here. Am I doing something wrong? Is there something wrong with the server?

Try registering ASP.NET with IIS using the following command:

aspnet_regiis /i

Also make sure that you have enabled the correct version of ASP.NET in IIS (Web Service Extensions folder):

You also have many unnecessary routes routes. For example the NewEmployee and Admin routes are totally equivalent meaning that only the first route in this list will ever be matched. But that's another problem, it is unrelated to the deployment errors you are getting. You could fix your routes once you make your application successfully run.