IIS 8.5禁用虚拟目录的重写规则
我有一个“默认网站”(又名wwwroot的Web.config)的重写规则,可以将所有HTTP请求重定向到HTTPS,如下所示:IIS 8.5禁用虚拟目录的重写规则,iis,https,url-rewriting,iis-8.5,Iis,Https,Url Rewriting,Iis 8.5,我有一个“默认网站”(又名wwwroot的Web.config)的重写规则,可以将所有HTTP请求重定向到HTTPS,如下所示: <rule name="http to https" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add
<rule name="http to https" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
现在,我想禁用或排除此目录下的虚拟目录,以便只能通过HTTP访问该目录。如何做到这一点
我尝试的内容:创建与virt.dir名称匹配的规则,并选择停止任何进一步的操作(未成功):
为第一条规则添加了否定条件(无成功)
我做错了什么?这不需要单独的规则
<system.webServer>
<rewrite>
<rules>
<remove name="testsite no https" />
</rules>
</rewrite>
</system.webServer>
或
将您的匹配条件从
更改为
,这样基本上,除了包含测试站点的URL之外,这将适用于所有URL
希望这能有所帮助。您不需要单独的规则
<system.webServer>
<rewrite>
<rules>
<remove name="testsite no https" />
</rules>
</rewrite>
</system.webServer>
或
将您的匹配条件从
更改为
,这样基本上,除了包含测试站点的URL之外,这将适用于所有URL
希望这能有所帮助。这也是我的第一个想法,但在我的浏览器中,我仍然得到了HTTPS重定向…更新的答案和另一个选择。你能试试吗?谢谢,但还是没有成功…:-/将您的匹配项从
更改为
,这样基本上除了包含testsite的URL之外,这将适用于所有URL。让我们来看看。这也是我的第一个想法,但在我的浏览器中,我仍然得到HTTPS重定向…更新了另一个备选答案。你能试试吗?谢谢,但还是没有成功…:-/将您的匹配项从
更改为
,这样基本上这将适用于除包含testsite的URL之外的所有URL。
<system.webServer>
<rewrite>
<rules>
<remove name="testsite no https" />
</rules>
</rewrite>
</system.webServer>