我无法将所有请求重定向到一个页面。我用了很多例子,但它们对我不起作用。我的最后一条规则:
<rule name="redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="exemple" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://www.exemple.org/en/abex" redirectType="Permanent" />
</rule>
我需要将网站中的所有页面重定向到 https://www.example.org/en/abex。但我有一个循环,也许是因为这个页面也重定向了?要不?我不知道。感谢您的回答。
您需要
创建否定匹配条件,该条件将从规则中排除https://www.example.org/en/abex
网址:
<rule name="redirect" stopProcessing="true">
<match url="^en/abex$" negate="true" />
<action type="Redirect" url="https://www.exemple.org/en/abex" redirectType="Permanent" />
</rule>