是否有方法使用IIS URL重写模块将URL从一个域重定向到新域



我们的系统中总共有两个域可用。一个是";示例";另一个是";exe";并且我们希望重定向来自";exe";域到";示例";领域我们想要执行完整的URL重定向。例如,如果我试图访问"https://exe.test.dir.com/xyz/ref?function=view则它应该只将URL中的域"exe"替换为"example",而不影响URL中的其他查询字符串。

尝试使用此规则

<rule name="rule">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="exe.test.dir.com" />
</conditions>
<action type="Rewrite" url="https://example.test.dir.com/{R:0}" />
</rule>

最新更新