C# 表单身份验证,允许/让所有人看到

C# 表单身份验证,允许/让所有人看到,c#,asp.net,forms-authentication,C#,Asp.net,Forms Authentication,我正在使用表单身份验证来保护我的应用程序 我在web.config中有以下内容: <authentication mode="Forms"> <forms loginUrl="Login.aspx" name="ProjectName" defaultUrl="Users.aspx" slidingExpiration="true" timeout="2000" path="/" /> </authentication> <location path

我正在使用表单身份验证来保护我的应用程序

我在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>

这允许我访问www.mysite.com/default.aspx,但我希望能够访问www.mysite.com,但当我尝试导航到该URL时,它会将我重定向到登录页面。



注意允许/拒绝元素:


请注意允许/拒绝元素:


当我将此添加到web.config时,我得到500。当我将此添加到web.config时,我得到500
<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.
<location path="/">
"/" - is for root dir(and inner)
"file_or_dir" - restricts only the specified file or directory