我想这些网址重定向。
实施例1:
http://wwww.old.com/News/List到http://wwww.new.com/News/List
实施例二:
http://wwww.old.com/News/List?page=1&type=2
到
http://wwww.new.com/News/List?page=1&type=2
实施例3:
http://wwww.old.com到http://wwww.new.com
我的设置如下
<rewrite>
<rules>
<rule name="site2.com" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="http://wwww.old.com" />
</conditions>
<action type="Rewrite" url="http://wwww.new.com/{R:0}" />
</rule>
</rules>
</rewrite>
1条答案
按热度按时间8wigbo561#
{HTTP_HOST}应匹配
wwww.old.com
而不是http://wwww.old.com
,您可以将rewrite
更改为redirect
,此规则可用作参考: