【发布时间】:2020-05-07 09:24:41
【问题描述】:
我在 IIS www、https 和旧 url 重定向中有 3 个规则。但它似乎陷入了一个循环,我得到了一个错误,有没有办法将这三个结合起来以防止这种情况发生?
<rule name="SSL" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
<rule name="www" stopProcessing="true">
<match url=".*"/>
<conditions>
<add input="{HTTP_HOST}" pattern="^test.com$"/>
</conditions>
<action type="Redirect" url="https://www.test.com/{R:0}" redirectType="Permanent"/>
</rule>
<rule name="OLD URL redirects">
<match url=".*"/>
<conditions>
<add input="{OldRedirects:{REQUEST_URI}}" pattern="(.+)"/>
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false"/>
</rule>
认为将它们结合起来可以解决问题吗?但我无法让它工作
【问题讨论】:
-
能否请您发布有关您对 url 重写规则的要求的详细信息。除了。我需要知道您使用的哪个域面临多重重定向错误。
标签: redirect iis mod-rewrite url-rewriting url-rewrite-module