【问题标题】:IIS Url Rewrite Full URL to New DomainIIS URL 将完整 URL 重写为新域
【发布时间】:2017-09-21 08:37:22
【问题描述】:

我正在为以下内容寻找 URL 重写规则:

我想将一个域 301 重定向到一个新域并保持完整的 URL 不变。

例如:

  • mydomain.co.uk/news > mydomain2.com/news
  • mydomain.co.uk/about > mydomain2.com/about
  • mydomain.co.uk/level1/level2 > mydomain2.com/level1/level2

以此类推。基本上是对喜欢的交换,只是要更改的域。

【问题讨论】:

    标签: redirect iis url-rewriting web-config iis-8.5


    【解决方案1】:

    您将在托管 mydomain.co.uk 的站点中添加这样的重写规则

    <rule name="Full URL to new domain">
        <match url="(.*)" />
        <action type="Redirect" url="http://www.mydomain2.com/{R:0}" />
    </rule>
    

    【讨论】:

    • 不识别 http 与 https
    猜你喜欢
    • 2017-08-07
    • 2013-08-23
    • 1970-01-01
    • 2013-08-16
    • 1970-01-01
    • 1970-01-01
    • 2021-09-20
    • 1970-01-01
    • 2017-03-02
    相关资源
    最近更新 更多