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?
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" />
精彩评论