【问题标题】:Need an Apache Redirect Rule需要 Apache 重定向规则
【发布时间】:2011-03-09 10:25:16
【问题描述】:

我需要以如下所示的方式重定向 url。

http://server1/em/10_10_26_01_02?utm_content=Top-Join-Now-Link&utm_medium=Web-version&utm_campaign=Email-send2&utm_source=InfoUSA&CMPID=778374938793

http://server2/em/10_10_26_01_02?utm_content=Top-Join-Now-Link&utm_medium=Web-version&utm_campaign=Email-send2&utm_source=InfoUSA&CMPID=778374938793

我需要将 url 从 Server1 更改为 Server2,除了每件事都是一样的。还有一件事是剩下的字符串不会是静态的,它每次都会改变。

【问题讨论】:

    标签: apache


    【解决方案1】:

    你需要以下规则

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^server1
    RewriteRule (.*) http://server2/$1 [R=301,L]
    

    更多详情请看这里:http://scriptplayground.com/tutorials/apache/Redirect-to-new-domain/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-28
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      相关资源
      最近更新 更多