跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 黑帽SEO-給真正訪客與搜索引擎不同的網站內容/頁面
未分類
2019 年 2 月 1 日

黑帽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://4563.org/");
exit();
}
?>

以上代码包含了各大主流搜索引擎的蜘蛛,把其中http://4563.org替换为你要跳转的地址即可,这段代码可以放在index.php文件中,或者网站的头部文件中即可。

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具