I am working on an ASP.NET web forms application that is using Forms Authentication. The problem is, it ignores my route and redirects to the login.aspx page.
I have the following route setup:
routes.MapPageRoute("/locale", "{locale}", "~/shorturl/transfer.aspx",
false,
new RouteValueDictionary { { "locale", "[a-z]{2}" } });
If I use the following url: http://server/minneapolis it goes to the login page. If I add the following to the Web.Config, then it "works" and goes to the transfer.aspx page.
<location path="minneapolis">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
I don't want to have to add all of the locales to the web.config, seems to defeat the purpose.
I can also change the route to (notice I added "/loc/"):
routes.MapPageRoute("/locale", "/loc/{locale}", "~/shorturl/transfer.aspx",
false,
new RouteValueDictionary { { "locale", "[a-z]{2}" } });
After that I can change the Web.Config location path to loc (location path="loc") and it works, but I'd really prefer to have it at the root. Is there any way to do this?
It's .NET v4 and I have to support IIS 7 and IIS 7.5