![]()
The HTTP 410 Gone status code indicates that the requested resource is no longer available on the server and will not be available again in the future. Unlike the 404 Not Found status code, which means the resource might be available later, 410 Gone explicitly states that the resource has been permanently removed.
Key Points
- The resource is permanently deleted or moved with no forwarding address.
- Clients should not attempt to request the resource again.
- This status code is useful for informing clients that a resource has been intentionally removed.
Common Causes
- Resource Deletion: The resource has been intentionally deleted by the server or an administrator.
- Expired Content: The resource was time-sensitive (e.g., a temporary file or promotional content) and has expired.
- No Redirection: The resource has been removed without a new location or alternative resource being provided.
How to Fix
- Client-Side Handling:
- Remove any references or links to the resource.
- Inform users that the resource is no longer available.
- Do not retry the request, as the resource is permanently gone.
- Server-Side Handling:
- Use the
410 Gonestatus code only when the resource is intentionally and permanently removed. - Provide a clear message in the response body explaining why the resource is gone.
- Log the removal of resources for auditing purposes.
Example
If a client requests a resource that has been permanently deleted, the server might respond:
HTTP/1.1 410 Gone
Content-Type: application/json
{
"error": "Gone",
"message": "The requested resource has been permanently removed and is no longer available."
}
Client-Side Handling
- Update the application or website to remove links or references to the deleted resource.
- Inform users about the removal and provide alternatives if available.
- Avoid retrying the request, as the resource will not be restored.
Server-Side Handling
- Use the
410 Gonestatus code to explicitly indicate permanent removal. - Include a clear and helpful message in the response body.
- Ensure that resources marked as
410 Goneare not accidentally restored or reused.
