404错误 [英] 404 errors

查看:115
本文介绍了404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道哪个是最好的新闻组,所以我把它分成三个。


我有几个网站工作正常。当我查看这些网站的

统计数据时,会有大量404错误

列表(如12,000)。这仅适用于我为服务器代码添加了

php编码的网站。来自同一个网络公司的其他网站

没有php没有404错误。


再次,操作中似乎没有错误

的网站正在计算这些错误。有没有人知道在这里发生什么可能会发生什么?

解决方案

sheldonlg写道:
< blockquote class =post_quotes>
我不知道哪个是最好的新闻组,所以我把它分成三个。


我有几个网站是工作得很好。当我查看这些网站的

统计数据时,会有大量404错误

列表(如12,000)。这仅适用于我为服务器代码添加了

php编码的网站。来自同一个网络公司的其他网站

没有php没有404错误。


再次,操作中似乎没有错误

的网站正在计算这些错误。有没有人知道这可能会发生什么?



只需检查那些404'的URL。最常见的是一些mod_rewrite

规则变得干扰,只是糟糕的网址创建。在我打电话给html页面时,我看到的最糟糕的情况是看到了404.php的页面,并且

因此为内容提供了不同的URL,非常糟糕。 />

然后再说一遍,404'是关于最不有趣的错误,如果所有内容

对用户都有效。谁在乎蜘蛛是否找不到robots.txt,

浏览器没有favicon.ico或没有index.html?

-

Rik Wasmus

.... spamrun完成


sheldonlg写道:


我不知道哪个是最好的新闻组,所以我把它分成三个。


我有几个网站运行正常。当我查看这些网站的

统计数据时,会有大量404错误

列表(如12,000)。这仅适用于我为服务器代码添加了

php编码的网站。来自同一个网络公司的其他网站

没有php没有404错误。


再次,操作中似乎没有错误

的网站正在计算这些错误。有没有人知道这可能会发生什么?



我做了一个小实验。在这个网站上从一个页面到另一个页面

不会产生任何额外的404错误,只要我使用html

页面。当我点击菜单项带我进入购物

卡(Zen Cart)时,404计数增加了7.如果我点击Zen

购物车菜单项目(不同的类别),然后它也增加了7.因为

Zen Cart是用PHP编写的,这不会发生在直接的HTML

页面中,并且我没有编写Zen Cart应用程序的代码,我被引导相信:


1 - 它与php有关

2 - 我没有编译错误产生这些404错误。


sheldonlg写道:


我做了一个小实验。在这个网站上从一个页面到另一个页面

不会产生任何额外的404错误,只要我使用html

页面。当我点击菜单项带我进入购物

卡(Zen Cart)时,404计数增加了7.如果我点击Zen

购物车菜单项目(不同的类别),然后它也增加了7.因为

Zen Cart是用PHP编写的,这不会发生在直接的HTML

页面中,并且我没有编写Zen Cart应用程序的代码,我被引导相信:


1 - 它与php有关

2 - 我没有不会产生编码错误来产生这些404错误。



我认为你的下一步是检查错误日志,看看*哪个*

页面/文件被调用生成一个404.然后在

中找到他们被调用的代码,并找出他们给出404的原因。

可以像某个目录一样简单或者一组文件没有

正确的权限。有些脚本需要生成新文件(例如缓存
),然后再从同一个脚本调用。如果该文件夹上的

权限不允许创建该文件,那么当它再次被调用时它将不会出现,因此生成404 。


切换PHP错误通知也可能直接给出一个线索

如果以上是这种情况。


另一个常见原因是图像。你不能错过的图片因为你从未见过它们,但是仍然会看到它们。


-

Els http://locusmeus.com/


I don''t know which is the best newsgroup for this, so I put it into three.

I have several sites that are working perfectly. When I look at the
statistics for these sites there are huge numbers of 404 errors
tabulated (like 12,000). This is only for sites where I have added the
php coding for the server code. Other sites from this same web company
that do not have php do not have the 404 errors.

Again, there seems to be no error in the operation of the sites where
these errors are being counted. Does anyone have an idea as to what may
be happening here?

解决方案

sheldonlg wrote:

I don''t know which is the best newsgroup for this, so I put it into three.

I have several sites that are working perfectly. When I look at the
statistics for these sites there are huge numbers of 404 errors
tabulated (like 12,000). This is only for sites where I have added the
php coding for the server code. Other sites from this same web company
that do not have php do not have the 404 errors.

Again, there seems to be no error in the operation of the sites where
these errors are being counted. Does anyone have an idea as to what may
be happening here?

Just check the URLS of those 404''s. Most common is some mod_rewrite
rules going haywire, of just lousy url-creation. The worst case I ever
saw was defaulting to a 404 .php page when calling an html page, and
thus providing a different URL for the content, horrible.

Then again, 404''s are about the least interesting errors if everything
works OK for the users. Who cares if spiders can''t find robots.txt,
browsers no favicon.ico or no index.html?
--
Rik Wasmus
....spamrun finished


sheldonlg wrote:

I don''t know which is the best newsgroup for this, so I put it into three.

I have several sites that are working perfectly. When I look at the
statistics for these sites there are huge numbers of 404 errors
tabulated (like 12,000). This is only for sites where I have added the
php coding for the server code. Other sites from this same web company
that do not have php do not have the 404 errors.

Again, there seems to be no error in the operation of the sites where
these errors are being counted. Does anyone have an idea as to what may
be happening here?

I did a little experiment. Going from page to page on this one site
did not produce any additional 404 errors so long as I stayed with html
pages. When I clicked on a menu item that took me into the shopping
card (Zen Cart), the 404 count increased by 7. If I clicked on a Zen
Cart menu item (different category), then it also increased by 7. Since
Zen Cart is written in php, and this doesn''t happen in straight html
pages, and I didn''t code the Zen Cart application, I am led to believe:

1 - It has something to do with php
2 - I didn''t make an coding error to produce these 404 errors.


sheldonlg wrote:

I did a little experiment. Going from page to page on this one site
did not produce any additional 404 errors so long as I stayed with html
pages. When I clicked on a menu item that took me into the shopping
card (Zen Cart), the 404 count increased by 7. If I clicked on a Zen
Cart menu item (different category), then it also increased by 7. Since
Zen Cart is written in php, and this doesn''t happen in straight html
pages, and I didn''t code the Zen Cart application, I am led to believe:

1 - It has something to do with php
2 - I didn''t make an coding error to produce these 404 errors.

I think your first next step is to check the error logs to see *which*
pages/files are being called that generate a 404. Then find where in
the code they are called, and figure out why they give a 404.

Could be as simple as a certain directory or set of files not having
the right permissions. Some scripts need to generate new files (cache
for example), which are then called from the same script later. If the
permission on the folder didn''t allow the file to be created, it will
not be present when it''s called again either, generating a 404.

Switching PHP error notification on might also give a clue straight
away if the above is the case.

Another common cause is images. Images you don''t miss because you
never saw them, but which are still called by the script.

--
Els http://locusmeus.com/


这篇关于404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆