Forms Authentication, allow / to be seen by all
I am using forms authentication to secure my application.
I have the following in web.config:
<authentication mode="Forms"> <forms loginUrl="Login.aspx" name="ProjectName" defaultUrl="Users.aspx" slidingExpiration="true" timeout="2000" path="/" /> </authentication> <location path="default.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>
This is allowing me to get to www.mysite.com/default.aspx, but I would like to be able to get to www.mysite.com, but when I try to navigate to that URL it redirects me to the login page.
<location path="/"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>
Pay attention to allow/deny elements: http://msdn.microsoft.com/en-us/library/8d82143t
<deny users="?" /> -- will deny access to all anonymous users, and redirect them to login page <allow users="*" /> -- will allow access to all users, even anonymous, without redirect to login page.
Where path could be:
"/" - is for root dir(and inner) "file_or_dir" - restricts only the specified file or directory