首页 > 其他 > 网站日记>正文

蜘蛛和人的饲料是 不同的

提示: 阅读权限:公开  
<?
function isCrawler() {
        $agent= strtolower($_SERVER['HTTP_USER_AGENT']);
        if (!empty($agent)) {
                $spiderSite= array(
                        "TencentTraveler",
                        "Baiduspider+",
                        "BaiduGame",
                        "Googlebot",
                        "msnbot",
                        "Sosospider+",
                        "Sogou web spider",
                        "ia_archiver",
                        "Yahoo! Slurp",
                        "YoudaoBot",
                        "Yahoo Slurp",
                        "MSNBot",
                        "Java (Often spam bot)",
                        "BaiDuSpider",
                        "Voila",
                        "Yandex bot",
                        "BSpider",
                        "twiceler",
                        "Sogou Spider",
                        "Speedy Spider",
                        "Google AdSense",
                        "Heritrix",
                        "Python-urllib",
                        "Alexa (IA Archiver)",
                        "Ask",
                        "Exabot",
                        "Custo",
                        "OutfoxBot/YodaoBot",
                        "yacy",
                        "SurveyBot",
                        "legs",
                        "lwp-trivial",
                        "Nutch",
                        "StackRambler",
                        "The web archive (IA Archiver)",
                        "Perl tool",
                        "MJ12bot",
                        "Netcraft",
                        "MSIECrawler",
                        "WGet tools",
                        "larbin",
                        "Fish search",
                );
                foreach($spiderSite as $val) {
                        $str = strtolower($val);
                        if (strpos($agent, $str) !== false) {
                                return true;
                        }
                }
        } else {
                return false;
        }
}


?>

<?
if(!isCrawler())header('Location: '.$public_r['add_renurl']?$public_r['add_renurl']:'http://www.zhongyf.com');

?>

判断你是不是蜘蛛,不是蜘蛛给你一个人看的页面。是蜘蛛,则给你另外一个页面。

上一篇:【帝国cms一千问】投稿栏目,能否对游客隐藏?

下一篇:节能评估报告模板

tags: 蜘蛛 饲料

返回首页

相关

热门

站内直通车

[!--temp.bottomnav--]
返回顶部