PHP判断用户UA给搜索引擎和用户展示不同页面

一种黑帽SEO站群常用的SEO手段。判断来路是搜索蜘蛛就让蜘蛛看到全部的页面代码,如果判断来路是真实的用户则跳转到注册页或者其他页面,既能达到想要的效果,又能做良好的seo优化。

<?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 == false){
header("Location: http://www.axseo.cn/");
exit();
}
?>

以上代码包含了各大主流搜索引擎的蜘蛛,把其中www.zylou.cn替换为你的网址即可,这段代码可以放在php网页中,或者网站的头部文件中即可。

软件工具黑帽资源

过期带备案域名扫描工具

2021-3-6 10:20:30

技术分享黑帽资源

火端搜索程序伪静态规则

2021-3-12 10:20:30

⚠️
本站提供的源码、模板、软件工具等其他资源,均不包含技术服务,请大家谅解!
本站所有内容仅限学习交流,请在下载后24小时之内自行删除,不要用于商业用途。
下载所需积分可通过日常 签到、评论、关注 等途径免费获得,详情查看任务中心
若您的权利被侵害,请联系站长 QQ: 45644699 或者 留言反馈 ,我们将尽快处理。
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索