可能从https重写排除子文件夹?
问题描述:
我有一个运行https的网站。现在一些程序员需要一个没有https的子码。可能从https重写排除子文件夹?
这就是我在我的web.config现在:
<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
我们需要从这个HTTPS排除的文件夹“的wp-content \休息”重定向。
希望有人能帮助我这个。
答
您需要添加一个附加条件到您的规则:
<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{REQUEST_URI}" pattern="^/wp-content/rest" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
则此规则将禁止重定向到像http://www.example.com/wp-content/rest*