小菜鸟 发表于 2011-3-30 12:16:36

求一个智能判断搜索蜘蛛的代码。

求代码。

7,8个域名备到一起。

北备,接入商要求网站打不开才行。yc005t yc005t
站打不开,搜索就全K了。
求一个智能判断搜索蜘蛛的代码。

用户打开网站的话,页面显示空白。
蜘蛛爬的话,网站正常。

直接用<div style="DISPLAY: none"></div>不会影响蜘蛛收录吧。

cnweb 发表于 2011-3-30 12:18:21

厉害

95147 发表于 2011-3-30 12:21:40

抄下dz有个叫is_robot的函数

Poison 发表于 2011-3-30 12:27:23

DNS智能解析:lol

小菜鸟 发表于 2011-3-30 12:31:59

求asp的代码和PHP的代码。
站点有ASP的也有PHP的。
最好是JS调用判断。

cookie 发表于 2011-3-30 12:32:01

<?php
function get_bot(){
    $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); //关键是这个

    if (strpos($useragent, 'googlebot') !== false){
      return 'Googlebot';
    }
    if (strpos($useragent, 'msnbot') !== false){
      return 'MSNbot';
    }

    if (strpos($useragent, 'slurp') !== false){
      return 'Yahoobot';
    }

    if (strpos($useragent, 'baiduspider') !== false){
      return 'Baiduspider';
    }

    if (strpos($useragent, 'sohu-search') !== false){
      return 'Sohubot';
    }

    if (strpos($useragent, 'lycos') !== false){
      return 'Lycos';
    }

    if (strpos($useragent, 'robozilla') !== false){
      return 'Robozilla';
    }
    return false;
}
?>
页: [1]
查看完整版本: 求一个智能判断搜索蜘蛛的代码。