简体   繁体   中英

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

There are total two domains available in our system. One is "example" and another one is "exe" and we want to redirect all requests from "exe" domain to "example" domain. we want to perform full URL redirection. for example if I am trying to access “https://exe.test.dir.com/xyz/ref?function=view” then it should only replace domain “exe” to “example” in URL without impacting other query string in URL.

Try to use this rule

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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