views:

508

answers:

1

I am trying to deploy a test ASP.NET MVC site to a site hosted on the Rackspace Cloud (essentially just the default site you get when you create a new ASP.NET MVC Web App in Visual Studio).

ASP.NET MVC does not appear to be installed so I have deployed the System.Web.Mvc.dll to the bin folder.

Now, when I access /Default.aspx I get the Home view. But if I enter /Home I get a 404 Page Not Found (I also get a 404 if I access the /Home/About URL).

I have tried adding the .aspx extension to my routes as defined in Global.asax to see if that made any difference but still got the same 404 error.

Am I right in thinking that I should be able to fix this via the Web.config file?

Thanks

+2  A: 

Did you try adding "Root" to the routes and the .aspx extension?

    routes.MapRoute(
        "Default",
        "{controller}.aspx/{action}/{id}",
        new { action = "Index", id = "" }
    );

    routes.MapRoute(
        "Root",
        "",
        new { controller = "Home", action = "Index", id = "" }
    );
Tony Borf
Nice one - this worked a treat! Thanks.
Ian Oxley