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.

Answers


<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.

And <location>:

<location path="/">

Where path could be:

"/" - is for root dir(and inner)
"file_or_dir" - restricts only the specified file or directory

Need Your Help

Slick Plain Sql Generic Return Type

sql scala generics slick

I am trying to write a configurable sql query executor using Slick. User provides a prepared statement with ? and at run time the exact query is formed by replacing ? with values.

Showing average of a value using Bar sign in Matlab

matlab plot label

I want to use bar sign (a line above a variable) to show the average of a variable. I found this code: