When trying to access my site:
www.X.com
The browser changes the url to:
www.X.com/
The problem is that the result url is:
www.X.com/HomePage.aspx?ReturnUrl=/
(HomePage.aspx is the default page)
On IE: www.X.com/HomePage.aspx?ReturnUrl=%2f
For some reason the Forms Authentication treats / as a page that the user is trying to access and then gets redirects to: HomePage.aspx?ReturnUrl=/
How can I set the Forms Authentication (or the MVC routing) not to treat / as a page, so when accessing www.X.com it will not change the url?
The site runs on windows server 2008 IIS7, .NET 4.
(When running on IIS6 it didn't have this problem)
Web.config:
<authentication mode="Forms">
<forms name=".AUTHCOOKIE" loginUrl="HomePage.aspx" defaultUrl="Loading.aspx" timeout="9480" />
</authentication>
MVC Routing (not sure it’s related):
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
routes.IgnoreRoute("{resource}.ascx/{*pathInfo}");
routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
routes.MapRoute("Actions", "A/{controller}/{action}", new { controller = "Tasks", action = "InitPage" });
}
Thanks
Rafael