HTTP 410 Gone Error Code: A Useful SEO Tool

HTTP Error 410 Gone

Understand the HTTP 410 Gone Error code: What are the causes, and solutions, and why we sometimes intentionally use this error response in SEO.

Table of Contents

What is the 410 Gone error?

The HTTP 410 Gone Client Error is a response code that indicates that requested resource is no longer accessible and that this condition is likely to be permanent.

This is an error message that is usually used to explicitly indicate that a certain resource or page is no longer available.

Different 410 error messages depending on the server and browser

Depending on the web server or browser you may find different descriptive messages for this error:

  • “HTTP Status 410”
  • “410 Gone”
  • “This page can’t be found -It may have been moved or deleted. HTTP ERROR 410”
  • “ERROR 410”
  • A Blank page, e.g. Firefox Browser.

For example, in Brave browser (based on the Chromium web browser), you’ll likely see a paper icon along with a simple message telling you “This web.domain page can't be found“:

Different 410 error messages depending on the server and browser
Default php 410 error message displayed in a Chromium browser

The default 410 Gone error displayed by Apache, looks like this:

Apache 410 gone error
410 Gone, Apache default page error

“410 Gone” vs “404 Not Found”

The “410 Gone” error can be confused with the “404 Not Found” error. Both error codes are used to communicate that the requested page or resource is not available.

The difference is subtle: The 410 Gone Error means “permanently not available” while the 404 Not Found means “temporarily not available”.

A common situation in which we encounter the 404 error is when we try to access a misspelled URL.

One use case where the HTTP 410 code is helpful is that of a malware infection. The malware may have published URLs with words in search engines that can damage our reputation. Showing a 410 is a way to indicate to crawlers that we do not have that content.

Error “410 Gone” vs “404 Not Found” for SEO

When Google crawls your website to index your pages, it will treat each page or resource differently depending on the HTTP code returned by the server.

In a Webmaster Hangout, Google’s John Mueller explained the difference:

The subtle difference here is that a 410 will sometimes fall out a little faster than a 404. But usually, we’re talking on the order of a couple days or so.

John Mueller, Senior Webmaster Trends Analyst at Google

Here in this Webmaster Hangout, you have the explanation from John Mueller:

Transcription:
– John Muller: “… from our point of view in the mid term, long term 404 is the same as 410, for us. So in both of these cases we drop those URLs from the index … we generally reduce crawling a little bit of those URLs, so that we don’t spend so much time crawling things that we know don’t exist. The subtle difference here is that a 410 will sometimes fall out a little bit faster than a 404. We usually are talking on the order of couple of days.”

Use the 410 Gone Status Code, if you want to speed up the process of Google removing the web page from their index.

Speeding up page removal from a search index can be especially useful after a malware intrusion, where a hacker infects a site with hundreds of spam pages and hideous URLs. Redirecting all those spam pages to a 410 Gone status page will help us speeding up the index deletion.

Solving the “410 Gone”

The 410 Error tends to be an intentional error code. Webmasters use it to declare that a resource is no longer available, so we can consider that it is not a random web error or server configuration error.

Having said that, if you experience a “410 Gone” error:

  1. It’s a good idea to check the link you are trying to visit. If there is no mistake in the URL, then,
  2. Take into account that the website owner might have intentionally removed the content or moved it to a new domain or URL.
  3. A final workaround is to look for the “product”, “service” or “content” by using some keywords on your preferred search engine.

How to create 410 errors for no longer existing pages?

How to configure the 410 error with Apache

You can redirect a page to the 410 Gone error using two different modules.

Redirect to the 410 error page with the Apache mod_alias module:

The easiest way to redirect to 410 error pages on Apache servers is to call the default 410 HTTP server response using the “Redirect” directive in your apache.config or .htaccess file:

Redirect gone /path/to/the/page_to_remove

Redirect to 410 error pages with the Apache mod_rewrite module

If you need more sophisticated redirections you can use the RewriteRule of mod_rewrite Apache module.

Reproducing the same previous redirect with a Rewrite command in your your apache.config or .htaccess file:

RewriteEngine On
RewriteRule ^/path/to/the/page_to_remove$ - [L,NC,G]

The flag “G” is the one in charge of showing the “Gone” error.

As mentioned, with this mod_rewrite module you can use regular expressions and target multiple pages at once:

RewriteEngine On
RewriteRule ^/path/to/the/(page_to_remove|page_to_eliminate|also_this_one)\.php$ - [L,NC,G]

How to configure the 410 error with Nginx

If you are working with Nginx, edit you nginx.conf file define a location block to target your single or multiple pages. Reproducing same previous sample URL: /path/to/the/page_to_remove

location = /path/to/the/page_to_remove { 
  return 410; 
}

And you can also take advantage of the regex rules in the location section like any other nginx location configuration. Reproducing previous sample of multiple pages:

location ~ ^/path/to/the/(page_to_remove|page_to_eliminate|also_this_one) { 
  return 410; 
}

At Wetopi we use Nginx for it’s performance, and best part is that you can use your own Free development servers to test configuration changes like the ones exposed in this article.

Save you website: don’t test in production!

When testing new server configurations, it is highly recommended to work on a “localhost” or “Staging” server.

If you don’t have a development WordPress server, signup at wetopi, it’s FREE.

How to show the 410 error with PHP code

If you want to show the “410 Gone” in a PHP page, all you need is to output the 410 header.

Paste the following code at the beginning of the affected page:

<?php
header( "HTTP/1.1 410 Gone" );
exit();

All HTTP Status Codes

200 OK

201 Created

202 Accepted

203 Non-Authoritative Information

204 No Content

205 Reset Content

206 Partial Content

207 Multi-Status

208 Already Reported

226 IM Used

300 Multiple Choices

301 Moved Permanently

302 Found

303 See Other

304 Not Modified

305 Use Proxy

307 Temporary Redirect

308 Permanent Redirect

400 Bad Request

401 Unauthorized

402 Payment Required

403 Forbidden

404 Not Found

405 Method Not Allowed

406 Not Acceptable

407 Proxy Authentication Required

408 Request Timeout

409 Conflict

410 Gone

411 Length Required

412 Precondition Failed

413 Payload Too Large

414 Request-URI Too Long

415 Unsupported Media Type

416 Requested Range Not Satisfiable

417 Expectation Failed

418 I’m A Teapot

421 Misdirected Request

422 Unprocessable Entity

423 Locked

424 Failed Dependency

426 Upgrade Required

428 Precondition Required

429 Too Many Requests

431 Request Header Fields Too Large

444 Connection Closed Without Response

451 Unavailable For Legal Reasons

499 Client Closed Request

500 Internal Server Error

501 Not Implemented

502 Bad Gateway

503 Service Unavailable

504 Gateway Timeout

505 HTTP Version Not Supported

506 Variant Also Negotiates

507 Insufficient Storage

508 Loop Detected

510 Not Extended

511 Network Authentication Required

599 Network Connect Timeout Error

We are techies passionate about WordPress. With wetopi, a Managed WordPress Hosting, we want to minimize the friction that every professional faces when working and hosting WordPress projects.

Not a wetopi user?

Free full performance servers for your development and test.
No credit card required.

See how Wetopi stacks up against your current hosting

Migrating sites to us is free and completely effortless on your part.

No hidden small text.
No commitments.
No credit card.

Try before you buy.