开发者

Need an Apache Redirect Rule

开发者 https://www.devze.com 2023-02-16 04:46 出处:网络
I need to redirect urls in such a way as shown below. 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&am

I need to redirect urls in such a way as shown below.

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

to

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&a开发者_开发知识库mp;CMPID=778374938793

I need to change the url from Server1 to Server2 other than that every thing is same. One more thing is like the remaining string wont be static and it will changes each and every time.


you need the following rule

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

See here for more details : http://scriptplayground.com/tutorials/apache/Redirect-to-new-domain/

0

精彩评论

暂无评论...
验证码 换一张
取 消