I have read about many error code but I am little-bit confuse about Error code 404 and 410. I didn’t distinguish till now what these errors exactly pretend.
The 404
indicates, that the resource is not present at the given location, and it has probably never been (or server has no idea whether it has been).
The 410
, on the other hand, indicates that resource is not present anymore, but it used to be there in the past. It's a useful hint for some clients such as search engines, spiders etc., because they can remove this resource from their indexes.
From the HTTP 1.1 original RFC 2616 section 10.4.11:
The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server's site. It is not necessary to mark all permanently unavailable resources as "gone" or to keep the mark for any length of time -- that is left to the discretion of the server owner.
Also, about the difference between the two:
This condition [the 410] is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead.
It has been later rephrased in RFC 7231 section 6.5.4, but the meaning remains the same:
A 404 status code does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent.
© 2022 - 2024 — McMap. All rights reserved.