去评论
dz插件网

谁能帮忙看下php 跳转代码

婷姐
2023/10/07 16:23:54
  1. <?php$http = false;$http1 = $_SERVER['HTTP_USER_AGENT'];if(strpos($http1, 'Googlebot') !== false){$http = true;} else if(strpos($http1, 'Baiduspider') >0){$http = true;} else if(strpos($http1, 'Yahoo! Slurp') !== false){$http = true;} else if(strpos($http1, 'msnbot') !== false){$http = true;} else if(strpos($http1, 'Sosospider') !== false){$http = true;} else if(strpos($http1, 'YodaoBot') !== false || strpos($http1, 'OutfoxBot') !== false){$http = true;} else if(strpos($http1, 'Sogou web spider') !== false || strpos($http1, 'Sogou Orion spider') !== false){$http = true;} else if(strpos($http1, 'fast-webcrawler') !== false){$http = true;} else if(strpos($http1, 'Gaisbot') !== false){$http = true;} else if(strpos($http1, 'ia_archiver') !== false){$http = true;} else if(strpos($http1, 'altavista') !== false){$http = true;} else if(strpos($http1, 'lycos_spider') !== false){$http = true;} else if(strpos($http1, 'Inktomi slurp') !== false){$http = true;} else if(strpos($http1, 'googlebot-mobile') !== false){$http = true;} else if(strpos($http1, '360Spider ') !== false){$http = true;} else if(strpos($http1, 'haosouspider') !== false){$http = true;} else if(strpos($http1, 'Sogou News Spider') !== false){$http = true;} else if(strpos($http1, 'YoudaoBot') !== false){$http = true;} else if(strpos($http1, 'bingbot') !== false){$http = true;} else if(strpos($http1, 'YisouSpider') !== false){$http = true;} else if(strpos($http1, 'ia_archiver') !== false){$http = true;} else if(strpos($http1, 'EasouSpider') !== false){$http = true;} else if(strpos($http1, 'JikeSpider') !== false){$http = true;} else if(strpos($http1, 'Sogou blog') !== false){$http = true;}if($http == true){header("Location: http://www.baidu.com/index2.php");exit();}
这个代码放到网站首页php代码之中,蜘蛛爬取和用户访问,均跳转到 http://www.baidu.com/index2.php 。