IIS7 or .Net 301 Redirects from 1 domain to another

久未见 提交于 2019-12-06 10:04:08

I think I would go for something like this using a rewrite module. Basically is saying that if is not going to your new domain then redirect it to it. passing the rest of the url that will by your custom rewrite module

 <rewrite>
        <rules>
            <rule name="CustomRule">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.new\.com$" negate="true" />
                </conditions>
                <action type="Redirect" url="http://www.new.com/{R:1}" />
            </rule>
        </rules>
    </rewrite>

Hope it helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!