Hello i have this code from what i can see as long as the referrer is blank it will redirect however what i want is for it to also redirect if the referrer is from a certain domain. Not just a site but any link from an entire domain. Also how would i add multiple domains. Thanks <?php $referer = $_SERVER['HTTP_REFERER']; if($referer =="") { echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.adomain.com\">"; } ?> Code (markup):
You can try this one <?php // Put the domains here $domains = array('yahoo.com', 'google.com', 'fbi.gov'); $referer = $_SERVER['HTTP_REFERER']; // Loop for each domain foreach ($domains as $dom) { if (stristr($referer, $dom)) {// match exit("<meta http-equiv=\"refresh\" content=\"0;url=http://www.adomain.com\">"); }; }; ?> PHP: