410 Gone
HTTP response status code 410 Goneis a client error that is returned by the server to indicate that the requested resource is permanently unavailable. This is similar to 404 Not Found, although it more specifically indicates that it did exist, but is unavailable and this is expected to be permanent.
Usage
When the 410 Gone error message is received, the client knows that the address was valid at one point, but the resource no longer exists. This can be the message returned by the server after a resource, such as a document available as part of a limited-time offer, expires. If the server does not expect this to be permanent then another code, like 404 Not Found, can be used instead.
This status code is helpful for web maintenance and is specific enough that clients need to remove links to the resource.
Note
Search engines like Google will not index a URL with 410 Gone response status, and consequently, URLs that have been indexed in the past but are now returning this HTTP status code will be removed from the search results.
Example
In the example, the client requests a resource and the server responds with a 410 Gone because the promotion has ended and the content is no longer available.
Request
GET /holiday-promotion-Jan-2021.pdf HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 410 Gone
Content-Type: text/html
Content-Length: 161
<html>
<head>
<title>Promotion Expired</title>
</head>
<body>
<p>The promotional period has ended and is no longer available.</p>
</body>
</html>
Code references
.NET
HttpStatusCode.Gone
Rust
http::StatusCode::GONE
Rails
:gone
Go
http.StatusGone
Symfony
Response::HTTP_GONE
Python3.5+
http.HTTPStatus.GONE
Java
java.net.HttpURLConnection.HTTP_GONE
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_GONE
Angular
@angular/common/http/HttpStatusCode.Gone
Takeaway
The 410 Gone status code is a client error sent by the server to indicate that the requested resource has been permanently removed. Clients need to remove existing links to the resource.