问题描述
我似乎无法找出我的论坛设置为他们不同的权限比其他网站。
I cannot seem to isolate my forums to set different permissions for them than the rest of the site.
下面是设置为我的网站。
Here is the setup for my site.
<location path=".">
<system.web>
<authentication mode="None" />
</system.web>
</location>
我需要隔离我的论坛。目前,用于测试目的,我把它设置,使所有用户都可以访问。
I need to isolate my forums. At the moment, for testing purposes, I have it setup so that all users are denied access.
<location path="~/public/public-forum.aspx">
<system.web>
<authentication mode="Forms">
<forms loginUrl="public/login.aspx" />
</authentication>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
什么我发现的是,我仍然可以访问该论坛网页。这表明,我认为这是不正确设置。
What I'm finding is that I can still access the forum page. This suggests to me that this isn't setup correctly.
是否路径属性必须是相对的?是否有指向的网址,该网页是通过访问或重写的路径? 〜/公/公forum.aspx
是这样,无论是直接改写虚拟路径,也不存在该文件与这些名字。为什么这个目前还没有工作呢?
Does the path attribute have to be relative? Does it have to point to the URL that the page is accessed through or the rewritten path? ~/public/public-forum.aspx
is a virtual path that is rewritten so neither the directly nor the file exists with those names. Why does this currently not work?
我希望这是足够的细节的解决方案。
I hope that's enough detail for a solution.
推荐答案
EDIT2:因此该解决方案是不仅在评论:
据我知道你不能指定每个位置上的authenticationmode。
您可以设置窗体身份验证模式,在整个网站中,只需要登录的用户在安全的部分。
edit2:So the solution isn't only in the comments :
As far as i know you cannot specify an authenticationmode per location.
You could set the forms authentication mode throughout your site and only require logged in users in the secure parts.
编辑:
mmmh奇怪,你确定你只编辑了〜走?
他们讨论你的问题此处,但我无法想象如何改变〜会触发它。
也许你可以发布你的整个的web.config?
另外:你使用IIS 6和虚拟目录
edit:
mmmh strange , are you sure you only edited the ~ away?
They discuss your problem here but i can't imagine how changing the ~ would trigger it.
Could you perhaps post your entire web.config?
Also : are you using iis 6 and virtual directories?
符号不需要〜,试试这个:
The ~ sign is not needed , try this :
<location path="public/public-forum.aspx">
<system.web>
<authentication mode="Forms">
<forms loginUrl="public/login.aspx" />
</authentication>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
这篇关于窗体身份验证不工作的特定页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!