问题
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?
回答1:
In your .htaccess file, assuming YourNewDestination.com is the desired destination:
RewriteEngine on
RewriteCond %{HTTP_REFERER} /search\.php$ [NC]
RewriteRule ^(.*)$ http://YourNewDestination.com
来源:https://stackoverflow.com/questions/35949427/how-to-redirect-traffic-that-comes-from-certain-domains-to-a-new-url