$referans = explode('/',$_SERVER['HTTP_REFERER']); if(!strstr($referans[2],"google")) { header("Location: http://www.siteniz.com/girisyasak.php"); }