开发者

New Google Images .htaccess redirect code

How do I make redirects in htaccess for traffic comming from "new" google images (google.com/images), instead of the old one (images.google.开发者_StackOverflow社区com) ?


Try this in your .htaccess:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://google.com/images [NC]
RewriteRule .* new-redirect-url [NC,L] 

Optionally, you can append R=301 to RewriteRule flags if you wish to do 301 redirect, like: NC,L,R=301.

Also, adjust referer URL if needed, this is sort of generic solution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜