Search code examples
asp.net-mvc-3routesiis-6membership

MVC3 Routing, IIS6


I have deployed my MVC3 application to an IIS6 server and have changed my global.asax.cs to read the following.

 routes.MapRoute(
                "Default", // Route name
                "{controller}.aspx/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

Everything works fine, /home/index redirects to home.aspx/index and so do the rest of the pages. The only problem is pages that require authorization. Instead of redirecting to Account.aspx/LogOn, it redirects to Account/LogOn. Any ideas on how to solve this?


Solution

  • Under authentication section in your web.config file you will find something like

    <forms loginUrl="~/Account/index" slidingExpiration="true" timeout="2880" protection="All" />
    

    change it to

    <forms loginUrl="~/Account.aspx/index" slidingExpiration="true" timeout="2880" protection="All" />