我的ASP.NET Forms 4.0网站正在运行窗体身份验证。默认情况下,未经授权的用户被拒绝,然后我允许访问某些页面。 我有一个问题,允许访问默认的网址:http:/example.com。我在web.config中找到相关定义默认页:允许匿名访问默认页面
<defaultDocument>
<files>
<clear/>
<add value="default.aspx" />
</files>
</defaultDocument>
,我有这样的定位越权:
<location path="default.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
它的工作原理确定,当我去的完整URL:http://example.com/default.aspx,但重定向到登录页面如果我去http://example.com
任何想法我做错了什么?
我知道你在做什么错误 - 'path'匹配被请求的路径,而不是它被重定向到的路径(在服务器端),所以http://mysite.com与默认值不匹配。 ASPX。我不能帮你修复它,虽然:( – Ryan 2011-05-06 20:39:57
请参阅我的答案有关删除ExtensionlessUrl模块[窗体身份验证忽略默认文档:](http://stackoverflow.com/questions/3824951/forms-authentication-ignoring-default -document) – 2011-07-07 13:26:21