本站所有内容仅限于本地断网调试与学习,如有侵权请邮件与我们联系处理!

网站首页 站群教程 引流跳转代码 正文

通过ua判断访客进行跳转的php代码

曹操 2020-12-06 引流跳转代码 268 ℃ 0 评论 3111字 free

现在越来越多的程序可以让搜索引擎爬虫和真实访客看到不同的页面,操作方式很简单,直接使用php识别用户ua就可以。

下面的这段php代码可以放在您的泛目录404.php中,将跳转的网址写成您指定的网址就可以了,譬如真实用户访问则跳转至当前网站的首页或其他指定页面。

<?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: 跳转的页面");
exit();
}
?>

Tags:引流代码跳转代码

必看说明

  • 本站中所有被研究的素材与信息全部来源于互联网,版权争议与本站无关。
  • 本站文章或仅为文本内容原创,非程序原创。如有侵权、不妥之处,请联系站长第一时间删除。敬请谅解!
  • 本站所有内容严格遵守国家法律的条例,所有研究的算法技术均来源于搜索引擎公开默认允许用户研究使用的接口。
  • 阅读本文及获取资源前,请确保您已充分阅读并理解《访问曹操SEO网站需知:行为准则》。
  • 本站分享的任何工具、程序仅供学习参考编写架构,仅可在本地的虚拟机内断网测试,严禁联网运行或上传搭建!
  • 任何资源必须在下载后24个小时内,从电脑中彻底删除。不得传播或者用于其他任何用途!否则一切后果用户自负!
  • 转载请注明 : 文章转载自  曹操资源网 通过ua判断访客进行跳转的php代码
  • 本文标题:《通过ua判断访客进行跳转的php代码》
  • 本文链接:http://www.ccooc.cc/673.html

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

网站分类
最新留言
文章归档
标签列表
站点信息
  • 文章总数:1332
  • 页面总数:1
  • 分类总数:47
  • 标签总数:337
  • 评论总数:39
  • 浏览总数:245225
嘿,欢迎咨询