博客首页
  • 用户名
  • 密码
  • 验证码
  • 网校首页
  • 博客首页
  • 论坛首页
看博发评论 人生真快乐!陈龙
看博发评论 人生真快乐! 一个程序员的思考 陈龙
个人资料
陈 龙 性别:男    所在地:北京市
2009年09月02日 12:51

[原创]对百度搜索引擎处理302, 301的猜测-陈龙

 查看apache的访问日志:
123.125.66.93 - - [02/Sep/2009:12:04:58 +0800] "GET /19/wdy999/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
220.181.7.63 - - [02/Sep/2009:12:05:04 +0800] "GET /7/zikao365all_zikao365/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.66 - - [02/Sep/2009:12:05:11 +0800] "GET /19/xujingui_chinalawedu/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
220.181.7.85 - - [02/Sep/2009:12:05:16 +0800] "GET / HTTP/1.1" 200 147599 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.120 - - [02/Sep/2009:12:05:25 +0800] "GET /2/CPA5752/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.86 - - [02/Sep/2009:12:05:38 +0800] "GET /2/XL650526/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.21 - - [02/Sep/2009:12:05:50 +0800] "GET / HTTP/1.1" 200 147599 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.122 - - [02/Sep/2009:12:05:51 +0800] "GET /2/baiyalan/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.74 - - [02/Sep/2009:12:06:03 +0800] "GET /2/dongyueying/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.66.83 - - [02/Sep/2009:12:06:14 +0800] "GET /2/lbaoqin1234/ HTTP/1.1" 302 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
 

发现baidu spider 仍然抓取的url地址为 /19/wdy999/  而我们使用php header函数转到了 /wdy999/这样的地址上

所以猜测:对于百度搜索引擎蜘蛛baidu spider 对302 仍然可以抓取到文章,但是对于url的收录仍然收录的是旧URL地址 /19/wdy999/


优化方法: 使用header("Location: /foo.php",TRUE,301);
 
 
 
// 301 Moved Permanently
header("Location: /foo.php",TRUE,301
);

// 302 Found
header("Location: /foo.php",TRUE,302
);
header("Location: /foo.php"
);

// 303 See Other
header("Location: /foo.php",TRUE,303
);

// 307 Temporary Redirect
header("Location: /foo.php",TRUE,307
);
?>
 

日志分类:网站SEO | 阅读(1401) | 收藏(0) | 评论(2) | 打印

最近读者 (登录后,您就出现在这里。这里登陆)


深海小妖
 评论读取中...
  • 发评论 (限500字以内)
  • 昵称:
  • 验证码:
  •  



以上网友发言只代表其个人观点,不代表中华会计网校博客的观点或立场。
array(2) { ["submit"]=> string(0) "" ["s"]=> string(0) "" } here