繁体   English   中英

有没有办法使用 IIS URL 重写模块将 URL 从一个域重定向到新域?

[英]Is there way to redirect URL from one domain to new domain using IIS URL rewrite module?

我们的系统中总共有两个域可用。 一个是“example”,另一个是“exe”,我们希望将所有请求从“exe”域重定向到“example”域。 我们想要执行完整的 URL 重定向。 例如,如果我试图访问“https://exe.test.dir.com/xyz/ref?function=view”,那么它应该只将 URL 中的域“exe”替换为“example”而不影响其他查询字符串网址。

尝试使用此规则

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM