What is HTTP Response Status Code 410 Gone?
HTTP response status code 410 Gone indicates that the requested resource is no longer available on the server and has been permanently removed. Unlike a 404 Not Found, which may imply that the resource could return in the future, a 410 clearly states that it is gone and will not be available again.
This status code is used when the server intentionally removes a resource and wants clients to be aware that the resource is permanently unavailable. It is often used when content is deleted for legal reasons or when services or resources are discontinued.
The 410 status code helps improve user experience by providing a more specific message than 404 Not Found, as it informs users that the content is intentionally no longer available. This can be particularly useful for SEO, as search engines will understand that they should stop indexing the removed page.
It is up to the client to decide how to handle this response, whether to remove the resource from bookmarks or simply display a message to users explaining that the content is no longer available.
Example 1: Removed Blog Post
# Client requests a blog post that has been removed. GET /blog/old-post HTTP/1.1 Host: www.example.com # Server Response HTTP/1.1 410 Gone Date: Wed, 09 Oct 2024 15:00:00 GMT Server: Apache/2.4.41 (Ubuntu) Content-Type: text/html { "error": "This blog post has been permanently removed." }
Example 2: Discontinued Product
# Client requests a product page that is no longer sold. GET /products/old-model HTTP/1.1 Host: www.example.com # Server Response HTTP/1.1 410 Gone Date: Wed, 09 Oct 2024 15:05:00 GMT Server: Nginx/1.18.0 Content-Type: application/json { "error": "The requested product is no longer available." }
Summary
The HTTP 410 Gone status code is used when a resource has been deliberately removed from the server. It is useful for notifying clients that the resource will not return in the future, making it more definitive than a 404 Not Found.
This code helps improve the user experience by providing clarity about the permanent unavailability of content, and it aids search engines in correctly handling removed content. Clients should use this information to remove outdated references to the resource.