[打印本页] [关闭本页] [返回列表页] [返回首页]
PR劫持的方法(ASP & PHP 301重定向篇)
分类:网站技术文章 发布时间:2008年7月14日 作者:风山渐 点击:
PR马上要更新了,奉上ASP与PHP的pr劫持代码,分享给大家学习,但是不要用在不正当的地方哦!
首先是ASP版:http://www.qudou8.com/ 是我要劫持的pr站
- user_agent = Request.ServerVariables("HTTP_USER_AGENT")
- if user_agent = "Googlebot" then '则判定访问google
- Response.Status = "301 Moved Permanently"
- Response.AddHeader "Location", "http://www.qudou8.com/"
- end if
接下来是PHP版:http://www.sseoo.com/ 是我要劫持的pr站
- if (strstr($_SERVER["HTTP_USER_AGENT"],"Googlebot")) {
- header("HTTP/1.1 301 Moved Permanently");
- header("Location: http://www.sseoo.com/");
- exit;
- }
- else {
- header("Content-Type: text/html; charset=ISO-8859-1");
- };
关于PR劫持:
通过301重定向可以让google误认为重定向的站为当前域名站,故可以将重定向站的PR劫持,使下次PR更新自己的站与指定站PR一致,不过此PR不是真实的PR,就是好看!
[打印本页] [关闭本页] [返回列表页] [返回首页]
