I am trying to redirect Visitors to a site based on their referrer url.
Visitors coming from "x" should be redirected to "x1" and Visitors coming from "y" should be redirected to "y1" and so on....
Here x and y are any website url(SOURCE) & x1 and y1 are also website url but these are DESTINATION..
i am trying to do the same with below written but its not working...
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/site1.com/",$referrer)) {
header('Location: http://www.customercare.com/page-site1.html');
exit;
};
?>
Lets say you have a page x.php which is in the server and y.php which a particular user is comming from.
Code for y.php
Code for x.php