我只希望IIS 7.5重写规则将http://www.domain.com/url1重定向到http://www.domain.com/url2(相同的域)。这可以通过以下方式实现:
<rule name="Redirect url" enabled="true" stopProcessing="true">
<match url="^url1" />
<action type="Redirect" url="http://www.domain.com/url2"
appendQueryString="false" redirectType="Permanent" />
</rule>
但是,该网站侦听多个域,因此以上内容已成为所有域的全局规则。我该如何特定于domain.com?尝试更改匹配网址并添加条件,但无法使其正常工作。谢谢。
我知道它是这样工作的:
<rule name="Redirect url1" stopProcessing="true">
<match url="^url1$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?domain.com$" />
</conditions>
<action type="Redirect" url="http://www.domain.com/url2"
appendQueryString="false" redirectType="Permanent" />
</rule>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句