VPS侦探论坛

 找回密码
 注册
查看: 8722|回复: 3

access.log问题

[复制链接]
发表于 2011-4-28 14:23:34 | 显示全部楼层 |阅读模式

为什么访问php返回200 而html返回404呢
下面是我的VPS中access.log文件部分内容


66.249.72.226 - - [28/Apr/2011:08:05:47 +0800] "GET /shigesanwen/20110422_1290.html HTTP/1.1" 404 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.72.226 - - [28/Apr/2011:08:17:17 +0800] "GET /plus/erraddsave.php?aid=478&title=%E7%9B%B8%E8%A7%81%C2%B7%E6%AC%A2-%E6%95%A3%E6%96%87%E5%B1%8B HTTP/1.1" 404 56 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:09:12:35 +0800] "GET /robots.txt HTTP/1.1" 404 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:09:12:35 +0800] "GET /plus/erraddsave.php?aid=481&title=%E5%BF%86%E6%B8%85%E5%9F%8E-%E6%95%A3%E6%96%87%E5%B1%8B HTTP/1.1" 404 56 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:09:17:35 +0800] "GET /shigesanwen/20110422_1381.html HTTP/1.1" 404 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:09:19:09 +0800] "GET /plus/erraddsave.php?aid=479&title=%E9%95%BF%C2%B7%E7%9B%B8%E6%80%9D-%E6%95%A3%E6%96%87%E5%B1%8B HTTP/1.1" 404 56 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
123.125.71.87 - - [28/Apr/2011:09:21:37 +0800] "GET / HTTP/1.1" 304 0 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)" -
123.125.71.86 - - [28/Apr/2011:09:21:39 +0800] "GET /qinggansanwen/ HTTP/1.1" 404 169 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)" -
123.125.71.83 - - [28/Apr/2011:10:27:03 +0800] "GET /sanwensuibi/ HTTP/1.1" 404 169 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)" -
66.249.68.1 - - [28/Apr/2011:10:32:01 +0800] "GET /gucifengyun/20110422_1354.html HTTP/1.1" 404 169 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
61.160.212.242 - - [28/Apr/2011:10:34:47 +0800] "GET http://218.30.115.246/ HTTP/1.1" 200 2142 "-" "-" -
123.125.71.87 - - [28/Apr/2011:11:31:51 +0800] "GET /shigesanwen/ HTTP/1.1" 404 169 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)" -
66.249.68.1 - - [28/Apr/2011:11:39:59 +0800] "GET / HTTP/1.1" 200 1067 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
123.125.71.84 - - [28/Apr/2011:12:36:39 +0800] "GET /tags.php HTTP/1.1" 404 56 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)" -
66.249.68.1 - - [28/Apr/2011:12:40:03 +0800] "GET /p.php HTTP/1.1" 200 5077 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:12:48:47 +0800] "GET /phpinfo.php HTTP/1.1" 200 10023 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:12:57:19 +0800] "GET /phpmyadmin/ HTTP/1.1" 200 1570 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:13:12:35 +0800] "GET /plus/erraddsave.php?aid=482&title=%E8%8A%B1%E9%A6%99%E8%AA%93%E8%A8%80-%E6%95%A3%E6%96%87%E5%B1%8B HTTP/1.1" 404 56 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
66.249.68.1 - - [28/Apr/2011:13:26:23 +0800] "GET /p.php?act=phpinfo HTTP/1.1" 200 10081 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-5-9 01:47:50 | 显示全部楼层


自定义404错误页面返回的状态码
404 : 请求的网页不存在(不排除日后该链接有效的可能性);
410 : 请求的网页不存在(永久);
200 : 服务器成功返回网页
302 : 网址临时重定向(跳转)
301 : 网址永久重定向
需要说明的是,大部分搜索引擎将“404”与“410”状态同等对待,如Google。
当搜索引擎在请求某个Url时得到“404”状态回应时,便会知道该网页在网站内不复存在,从而在索引数据库中将其删除,——当然,这个删除过程有可能需要很长时间——而当搜索引擎得到“200”状态回应时,则会认为该url是有效的,并将其回到到索引数据库中。

404错误页返回“200”状态码的后果
如果网站的自定义404错误页面在url无效时不返回“404”状态码而代之以“200”,会发生什么情况呢?很明显,搜索引擎会认为这个“根本不存在的”网页在网站内是存在的,这会导致很多问题,影响网站的最终SEO效果。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-5-9 09:18:48 | 显示全部楼层

回复 2# 的帖子


一键安装LNMP
用的伪原创,做了301,网站运转正常,不带WWW有可以正常跳,规则:

server
{
server_name 120j9.com;

rewrite ^(.*) http://www.120j9.com$1 permanent;

}

分析日志:
……
[06/May/2011:17:42:53 +0800] "GET /ask/38226.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.53 - - [06/May/2011:17:42:57 +0800] "GET /ask/38224.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.58 - - [06/May/2011:17:43:00 +0800] "GET /ask/38231.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.47 - - [06/May/2011:17:43:00 +0800] "GET /ask/38236.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.46 - - [06/May/2011:17:43:04 +0800] "GET /ask/38228.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.55 - - [06/May/2011:17:43:06 +0800] "GET /ask/38243.html HTTP/1.1" 301 185 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
123.125.71.56 - -
……
全都是这样的,   301 185
这是怎么回事,会惩罚吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-5-9 10:00:09 | 显示全部楼层



你不做301不就是200了吗
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 12:20 , Processed in 0.026145 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表