$ip = $_SERVER['REMOTE_ADDR']; if ($ip == 127.0.0.1) { //Veiksmas } else { header('Location: http://www.google.com/'); }