How to redirect traffic that comes from certain do

2019-09-19 00:27发布

I need to redirect traffic for all the visitors coming from a bunch of domains, but they all have the same page.

So all referrers like this:

hxxp://domain1.com/search.php
hxxp://domain2.com/search.php
hxxp://domain3.com/search.php

So when these visitors come to my page, they will be redirected through another url, however all other referring visitors will go to the site.

Ideas?

标签: referer
1条回答
老娘就宠你
2楼-- · 2019-09-19 01:03

In your .htaccess file, assuming YourNewDestination.com is the desired destination:

RewriteEngine on
RewriteCond %{HTTP_REFERER} /search\.php$ [NC]
RewriteRule ^(.*)$ http://YourNewDestination.com
查看更多
登录 后发表回答