gpt4 book ai didi

seo - 404 和 410 错误代码之间的区别

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:29:03 24 4
gpt4 key购买 nike

我读过很多错误代码,但我对错误代码 404 和 410 有点困惑。直到现在我都没有区分这些错误到底是什么。

最佳答案

404 表示资源不存在于给定位置,并且可能从未存在过(或者服务器不知道它是否存在过)。

另一方面,410 表示资源不再,但过去曾经存在。对于某些客户端(如搜索引擎、蜘蛛等)来说,这是一个有用的提示,因为它们可以从它们的索引中删除该资源。

来自 HTTP 1.1 原文 RFC 2616 section 10.4.11 :

The 410 response is primarily intended to assist the task of webmaintenance by notifying the recipient that the resource isintentionally unavailable and that the server owners desire thatremote links to that resource be removed. Such an event is common forlimited-time, promotional services and for resources belonging toindividuals no longer working at the server's site. It is notnecessary to mark all permanently unavailable resources as "gone" orto keep the mark for any length of time -- that is left to thediscretion of the server owner.

另外,关于两者的区别:

This condition [the 410] is expected to beconsidered permanent. Clients with link editing capabilities SHOULDdelete references to the Request-URI after user approval. If theserver does not know, or has no facility to determine, whether or notthe condition is permanent, the status code 404 (Not Found) SHOULD beused instead.

后来在 RFC 7231 section 6.5.4 中改写了它, 但含义保持不变:

A 404 status code does notindicate whether this lack of representation is temporary orpermanent; the 410 (Gone) status code is preferred over 404 if theorigin server knows, presumably through some configurable means, thatthe condition is likely to be permanent.

关于seo - 404 和 410 错误代码之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28876772/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com