410 Gone
The resource used to be here, has been removed deliberately, and the server expects that to be permanent. There is no forwarding address.
What 410 means
A 410 is a 404 with two extra pieces of information: the URL was once valid, and its removal is intentional and likely to be permanent. The specification describes its purpose as helping web maintenance, by telling whoever holds a link that the owner wants it removed.
If the server does not know whether the absence is permanent, it should say 404. Nor is anyone obliged to use 410 for everything that has been deleted, or to keep the marker for ever; that is left to the site owner.
Like a 404, a 410 is cacheable by default. If you restore a page that has been answering 410, browsers and CDNs may go on serving the stored 410 until it expires. Send Cache-Control with it if you might change your mind.
When to use it, and when not
Good candidates:
- A discontinued product, an expired listing or a finished promotion with no successor.
- User content that was deleted by its owner or taken down.
- A retired API version or endpoint, so that clients fail with a clear signal instead of guessing.
- Spam or hacked pages you have cleaned up and want forgotten.
Choose something else when:
- the content moved or has a close replacement: redirect with 301, which keeps visitors and the value of inbound links;
- the absence is temporary: use 503 for maintenance, or leave a 404;
- the URL never existed: that is a plain 404;
- the caller is not allowed to know whether it existed.
Setting it up
- nginx:
location = /old-page { return 410; }, or amapof retired paths for longer lists. - Apache:
Redirect gone "/old-page", orRewriteRule "^old-section/" "-" [G]for patterns. - In an application: keep a "deleted" marker instead of removing the row outright. Without one the application cannot tell a deleted record from one that never existed, and can only answer 404.
Give the response a body that people can use: say that the page has been removed, and link to the nearest live section. Then remove your own internal links and sitemap entries that still point at it.
410 and search engines
Google's documentation treats 404 and 410 alike, along with every other 4xx code except 429: content from the URL is ignored, an indexed URL is removed, and the URL is crawled less and less often. So a 410 is not a faster removal tool in any documented sense. Its value is precision, for people reading logs, for API clients, and for crawlers that do distinguish the two.
Do not answer 410 across a whole site to throttle crawlers. 4xx codes other than 429 have no effect on crawl rate and will get pages dropped.
410 compared with 404 and 301
| Code | Says | A client should |
|---|---|---|
| 410 Gone | Removed on purpose, permanently | Delete the link and stop asking |
| 404 Not Found | Nothing here; no reason or duration given | Check the URL; it may work another time |
| 301 Moved Permanently | Gone from this URL, available at another | Follow Location and update the link |
Example 410 response
HTTP/1.1 410 Gone
Content-Type: text/html; charset=utf-8
Content-Length: 94
Cache-Control: max-age=86400
<h1>This page has been removed</h1><p>See the <a href="/catalogue/">current catalogue</a>.</p>The explicit Cache-Control gives the 410 a known lifetime of one day in caches, instead of leaving it to each cache's own heuristics.
Defined in RFC 9110, section 15.5.11.
Questions
What is the difference between 404 and 410?
A 404 says nothing is at the URL and gives no reason. A 410 says something was there and has been removed deliberately and permanently. Use 410 only when you know both of those things; otherwise 404 is the correct answer.
Is 410 better than 404 for SEO?
Google documents no difference: both lead to the URL being dropped from the index and crawled less often. Use 410 because it is accurate, not because you expect faster removal. If the page has a replacement, a 301 redirect is better than either.
How do I return a 410 in nginx or Apache?
In nginx, add a location for the path containing "return 410;". In Apache, use "Redirect gone /old-page" from mod_alias, or a RewriteRule with the [G] flag.
Should a deleted API resource return 404 or 410?
Either is acceptable. 410 is more informative if the server keeps a record of deleted IDs, because it tells the client the ID was valid and has gone. If deleted rows are simply removed, the server cannot know and should return 404.