【发布时间】:2017-02-27 20:14:29
【问题描述】:
我有两个域,www.example.com 和 www.example.xx。
当我访问 example.com 并更改语言时,我的地址更改为 example.com/xx。在这种情况下,我想重定向做另一个域后缀,例如 example.xx。但我仍然想转发完整的地址路径。
例如:http://example.com/xx/one/two/three/four/five/?query=string 应该重定向到 http://example.xx/one/two/three/four/five/?query=string
我尝试了几种方法,但都没有成功。
<rewrite>
<rules>
<rule name=".com xx Redirect" stopProcessing="true">
<match url="(www\.)?example\.com\/xx\/.*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" pattern="^xx\/(.*)" />
</conditions>
<action type="Redirect" url="http://example.xx/{C:1}" appendQueryString="true" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
【问题讨论】:
标签: url redirect iis url-rewriting rule