阻止除umbraco管理员之外的所有人访问目录



我在Default Umbraco目录下创建了一个文件夹。我尝试在这个新创建的文件夹中添加一个web.config文件,然后添加了以下配置

<configuration>
<system.webServer>
<security>
<authorization>
<allow user="umbracoUsername"/> 
<deny users="*"/>
</authorization>
</security>
</system.webServer>
</configuration>

其目的是只允许Umbraco管理员(如设置为Administrators的组中(访问此目录和内容,而不允许其他人访问。

上面允许所有用户访问这个目录/内容,我看到的所有示例都与上面类似。

我做错什么了吗?该网站在IIS(Windows Server 2012(下运行,我使用Umbraco 7。

web.config配置错误,可以参考以下代码:

<configuration>
<system.web>
<!-- This section denies access to all files in this application except for those that you have not explicitly specified by using another setting. -->
<authorization>
<deny users="?" />
</authorization>
</system.web>
<!-- This section gives the unauthenticated user access to the umbracoonly. It is located in the same folder as this configuration file. -->
<location path="umbraco">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
</configuration>

有关配置访问特定文件和文件夹的更多信息,您可以参考此链接:配置访问特定的文件和文件夹

最新更新