【发布时间】:2018-02-06 19:08:21
【问题描述】:
在我的 web.config 应用程序中是:
<authentication mode="Forms">
<forms loginUrl="app/Login.aspx" name=".ASPXFORMSAUTH" protection="All" slidingExpiration="true" timeout="10"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
在app文件夹的web.config中是:
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<directoryBrowse enabled="false"/>
<defaultDocument enabled="true">
<files>
<clear/>
<add value="Default.aspx"/>
</files>
</defaultDocument>
<handlers accessPolicy="Read, Script, Execute"/>
<staticContent enableDocFooter="false">
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:00:00"/>
</staticContent>
<asp enableParentPaths="false" scriptLanguage="VBScript" bufferingOn="true">
<limits scriptTimeout="00:01:30"/>
<session allowSessionState="true" timeout="00:20:00"/>
</asp>
<security>
<authentication>
<anonymousAuthentication enabled="true" password="" userName="IUSR"/>
<basicAuthentication enabled="false" realm="" defaultLogonDomain=""/>
<windowsAuthentication enabled="false"/>
<digestAuthentication enabled="false" realm=""/>
</authentication>
</security>
<httpLogging dontLog="true"/>
</system.webServer>
</configuration>
这项工作,但我想为匿名用户授予对 my_public 文件夹的访问权限。 在 my_public 文件夹中是站点 about.aspx。
在 my_public 文件夹的 web.config 中是:
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<directoryBrowse enabled="false"/>
<defaultDocument enabled="true">
<files>
<clear/>
<add value="Default.aspx"/>
</files>
</defaultDocument>
<handlers accessPolicy="Read, Script, Execute"/>
<staticContent enableDocFooter="false">
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:00:00"/>
</staticContent>
<asp enableParentPaths="false" scriptLanguage="VBScript" bufferingOn="true">
<limits scriptTimeout="00:01:30"/>
<session allowSessionState="true" timeout="00:20:00"/>
</asp>
<security>
<authentication>
<anonymousAuthentication enabled="true" password="" userName="IUSR"/>
<basicAuthentication enabled="false" realm="" defaultLogonDomain=""/>
<windowsAuthentication enabled="false"/>
<digestAuthentication enabled="false" realm=""/>
</authentication>
</security>
</system.webServer>
<system.web>
<authorization>
<allow roles="*"/>
</authorization>
</system.web>
</configuration>
当用户转到 my_public/about.aspx 时,总是会重定向到 app/login.aspx。 匿名用户应重定向到 my_public/about.aspx。
【问题讨论】:
标签: asp.net iis web-config authorization