【黑帽SEO專用】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.yetiskinlerchat.com/");exit();}?以上代碼包含了各大主流搜索引擎的蜘蛛,把其中www.yetiskinlerchat.com替換為你的網址即可,這段代碼可以放在php網頁中,或者網站的頭部文件中即可。