410 Gone: what it means, 410 vs 404, and how to set it up

A 410 says a page was removed on purpose and isn't coming back. How it differs from a 404, when to use it, how to return it in nginx, Apache and Express, and how to fix an unexpected one.

· 6 min read · By the Spot Downtime team

410 Gone means the server knows the resource used to exist, it has been removed deliberately, and there is no forwarding address. It is the more specific cousin of 404 Not Found, which only says “I can't find that” and makes no promise about the future.

Most visitors see no difference between the two. The difference matters to crawlers, to API clients, and to you when a 410 shows up somewhere you didn't put it.

410 vs 404

  • 404: not found. Maybe it never existed, maybe the URL is mistyped, maybe it's temporarily missing. Clients may try again later.
  • 410: gone. It existed, it was removed on purpose, and it's permanent. Clients should stop requesting it and remove links to it.

The HTTP spec says a 410 is cacheable by default and that a server should use it only when it's reasonably sure the removal is permanent. If you aren't sure, use 404.

What 410 does for SEO

Search engines treat both codes as “this page no longer exists” and drop the URL from the index. A 410 is a clearer signal and can get a page removed somewhat sooner, but Google has said the two are handled very similarly, so don't expect a dramatic difference. What does matter is that you return a real error code. A deleted page that returns 200 with a “sorry, page not found” message is a soft 404, and crawlers will keep revisiting it.

If the content moved, don't use 410 at all. Use a 301 redirect to the new page so visitors and link value follow it.

When to return a 410

  • A discontinued product with no replacement.
  • A campaign, event or promotion page that has ended for good.
  • Spam or hacked pages you cleaned up and want gone from search results.
  • An API resource that was deleted, where clients should stop polling it.
  • An old API version you have retired.

How to return a 410

nginx

location = /old-campaign {
    return 410;
}

# a whole section
location ^~ /discontinued/ {
    return 410;
}

Apache (.htaccess)

# one URL
Redirect gone /old-campaign

# a pattern, using mod_rewrite
RewriteEngine On
RewriteRule ^discontinued/ - [G]

Express (Node.js)

app.get("/old-campaign", (req, res) => {
  res.status(410).send("This page has been permanently removed.");
});

Give the 410 page a helpful body: say what happened and link to the home page or a search. Visitors reach these URLs from old bookmarks and links, and a blank page helps nobody.

If you get a 410 you didn't expect

First, confirm what the server returns, without a browser cache in the way:

curl -I https://example.com/some-page

Then work through the usual causes:

  • The page was deleted. Someone removed a post, product or file in the CMS. Restore it, or redirect it with a 301.
  • A soft-delete in an API. Many APIs return 410 for a record that was deleted or expired, such as a used invite link or a revoked token. Check whether the ID is stale.
  • A redirect or rewrite rule too broad. A pattern like RewriteRule ^blog - [G] catches more URLs than intended. Check your server config, .htaccess and CDN rules.
  • A security plugin or WAF. Some tools return 410 to block known-bad URLs or bots. Check their logs.
  • A cached 410. Because 410 is cacheable, a CDN or browser can keep serving it after you restore the page. Purge the CDN cache and test in a private window.

Fixing a page that is still indexed as gone

If you restore a page that returned 410 for a while, search engines may have dropped it. Make sure it returns 200, is in your sitemap, and request re-indexing in Search Console. It can take days to come back.

Monitoring and 410

An uptime monitor treats any 4xx response as a failure by default, which is what you want for a page that should be up. If a URL is retired on purpose, delete or pause its monitor so it doesn't alert, and point monitors at pages that should exist.

To find stray 404s and 410s across a site, run your important URLs through a bulk check after each content cleanup or migration.

Bulk HTTP status code checkerCheck up to 25 URLs at once and see the final status code after every redirect.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading