问题:asp.net 我的web.config 配置了- <connectionStrings>
- <add name="connString" connectionString="server=xxxx;uid =sa;pwd =sa;database =xxx" />
- </connectionStrings>
- <location path="Admin/Login.aspx">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location>
- <location path="Admin/Reisgter.aspx">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location>
- <location path="Admin/FindPassword.aspx">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location>
- <location path="Admin/ShowMsg.aspx">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location>
- <location path="~/Default.aspx">
- <system.web>
- <authorization>
- <allow users="*" />
- </authorization>
- </system.web>
- </location>
-
- <system.web>
- <httpRuntime executionTimeout="3600" maxRequestLength="1048576" />
- <compilation debug="true" targetFramework="4.0"></compilation>
- <customErrors mode="Off" />
- <identity impersonate="true" />
- <authentication mode="Forms">
- <forms name="forums" path="/" loginUrl="Admin/Login.aspx" defaultUrl="Default.aspx" protection="All" timeout="1440">
- </forms>
- </authentication>
- <authorization>
- <deny users="?"/>
- <!--阻止匿名用户访问-->
- </authorization>
- <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
- </system.web>
- <system.webServer>
- <defaultDocument>
- <files>
- <clear />
- <add value="Default.aspx" />
- <add value="Default.htm" />
- <add value="Default.asp" />
- <add value="index.htm" />
- <add value="index.html" />
- <add value="iisstart.htm" />
- </files>
- </defaultDocument>
- <httpErrors errorMode="Detailed" />
- </system.webServer>
- </configuration>
复制代码
然后直接访问网站http://10.10.128.13 没有转到默认的Defualt.aspx页面 而是跳到http://10.10.128.13/Admin/Login.aspx?ReturnUrl=%2f ,而我已经设置Default.aspx页面允许匿名访问这是为什么呀? 如何使直接http://10.10.128.13/Default.aspx页面是可以访问的(不用登录)
敬请那个大神指教一下 |