本博客提供易企cms建站仿站教程,包教包会,不收取任何费用,菜鸟都可以学会的易企cms建站仿站教学。交流群:38465641 程序或者seo方面的问题不懂的可以随时咨询我。
爬虫
function is_spider(){
$robot = 0;
$USER_AGENT = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($USER_AGENT,"bot")) $robot = 1;
if(strpos($USER_AGENT,"spider")) $robot = 1;
if(strpos($USER_AGENT,"slurp")) $robot = 1;
if(strpos($USER_AGENT,"mediapartners-google")) $robot = 1;
if(strpos($USER_AGENT,"fast-webcrawler")) $robot = 1;
if(strpos($USER_AGENT,"altavista")) $robot = 1;
if(strpos($USER_AGENT,"ia_archiver")) $robot = 1;
return $robot;
}
if (is_spider()) {
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: https://www.baidu.com/");
}
评论