我试图忽略谷歌adword即将到来。
Url进入:
/location/&gclid=287ejek22kj
由于gclid ......这是一个404页面。
我需要它去:
/location
我试过这个,没有成功:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)&gclid=(.*)$ $1 [L]
感谢所有帮助。感谢。
答案 0 :(得分:0)
在这里工作:
192.168.1.2 - - [01/May/2011:05:38:48 +0100] [192.168.1.2/sid#938b98][rid#2789a40/initial] (3) [perdir C:/HTTP/htdocs/] strip per-dir prefix: C:/HTTP/htdocs/location/&gclid=287ejek22kj -> location/&gclid=287ejek22kj 192.168.1.2 - - [01/May/2011:05:38:48 +0100] [192.168.1.2/sid#938b98][rid#2789a40/initial] (3) [perdir C:/HTTP/htdocs/] applying pattern '^(.*)&gclid=(.*)$' to uri 'location/&gclid=287ejek22kj' 192.168.1.2 - - [01/May/2011:05:38:48 +0100] [192.168.1.2/sid#938b98][rid#2789a40/initial] (2) [perdir C:/HTTP/htdocs/] rewrite 'location/&gclid=287ejek22kj' -> 'location/'
检查您的重写日志。请参阅RewriteLog
和RewriteLogLevel
。
答案 1 :(得分:0)
看起来没问题,但你也可以试试这个:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteRule ^([^&]+)&gclid=.*$ /$1 [L,NC,R=301]