is there a script that can forward to a particular website based on the referrer?

tmelan

Newbie
Joined
Oct 28, 2011
Messages
15
Reaction score
2
eg, if it came from url A - forward to url B or if it came from url C - forward to url D .. Just wondering if such a script exists?
 
You can do this a few ways..

PHP -

Code:
<?
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/site1.com/",$referrer)) {
      header('Location: http://www.customercare.com/page-site1.html');
} elseif (preg_match("/site2.com/",$referrer)) {
      header('Location: http://www.customercare.com/page-site2.html');
} else {
      header('Location: http://www.customercare.com/home-page.html');
};
?>

Adding it to htaccess - http://opensourcehacker.com/2011/09/19/http-referer-based-redirects-in-apache/

Here - http://lmgtfy.com/?q=redirect+traffic+based+on+referrer
 
Back
Top