410 Gone Error - What Does It Mean and How to Fix It
What does a
410 Gone error mean?
410 Gone error occurs when a user tries to access an asset which no longer exists on the requested server. In order for a request to return a
410 Gone status, the resource must also have no forwarding address and be considered to be gone permanently. This is the key differentiator from a
404 Not Found in that with a
404 error, the server does not know if the resource may be available again in the future.
How you might see a
410 Gone error
There are a few different ways that you might see a
410 Gone error. The following list outlines a few of these variations that you may see depending upon the web server that is being used. Although they are slightly different, each one means the same thing.
- 410 Gone
- Error 410
- HTTP Status 410
410 Gone errors
In some cases,
410 Gone errors might be intentional. As explained further below, this is true if a website is running a promotion for a limited time and once that time has expired the page can return a
410 Gone. However, not all
410 error cases are intentional nor are they the same.
4xx errors are categorized to be client error responses however this doesn't necessarily mean that the issue is on the client side. Below we'll explore some reasons for why
410 Gone errors may occur on both the client side as well as the server side.
- Wrong URL: One of the most common reasons why a
410 Goneerror is returned due to a client side issue is because of a wrong URL entered. Now, in many cases, a wrong URL will result in a
404 Not Foundhowever, if there was a resource present at that URL during a given time and the server was configured to return a
410status code for that resource, that is what the client will receive.
- Application or platform changes: Whether you're using a popular CMS like WordPress or Joomla, or have a custom application built from the ground up, adding plugins, modules, or upgrades can result in unwanted changes. If you've experienced a
410 Goneerror after doing any one of the aforementioned actions you should consider reverting any changes made until you can determine the cause of the issue. In the case of certain plugins/modules you may also need to verify your database to ensure that no changes were made to the database or any changes that were made were reverted once you uninstalled them.
- Investigate the logs: The first thing to do on the server when receiving an unexpected HTTP status code is to check the logs. The location of your server's log files will depend on which server you're using: Nginx vs Apache, or any other. Open the log file and run a search for
410errors, this should at least point you in the direction of where the error is originating from.
- Unwanted redirects: The second thing to check on the server side if you're experiencing
410 Goneerrors is the configuration file for unwanted redirects. If you're using Apache then you'll want to check both the apache server configuration file as well as the
.htaccessfile. If you're using Nginx then you'll need to check the
nginx.conffile. Within these files do a search for "410" and see if anything comes up. If it does, you should take a closer look at what the redirect rule is actually doing. It may need to be modified in order to apply to only a specific page (if that is your intention) and can be removed entirely if not required.
When to use a
410 Gone instead of a
404 Not Found
As a web developer, it's important to know when to use a
410 Gone error instead of a
404 Not Found. Using the proper status code is beneficial for a couple of reasons:
- It lets users know that the resource no longer exists, therefore they should not try and access it again
- Googlebot treats each status code slightly differently.
If you're the owner of a resource and decide to intentionally remove said resource from your origin server permanently, then a
410 error should be returned to any subsequent users trying to access it. This also tells any websites linking to the resource to remove it as a link as it is no longer applicable.
Additionally, according to Matt Cutts, Googlebot treats
410 errors slightly different. If Googlebot comes across a
404 status, it protects that page in the crawling system as if to say "perhaps this status was returned accidentally" and does not classify it as an error immediately. On the other hand, if Googlebot comes across a
410 status, it assumes that the webmaster has intentionally set the status for this resource to
410 and therefore Googlebot immediately classifies it as an error. Google does however periodically recrawl pages/resources that have previously returned a
410 status just to check if anything has changed.
Therefore, if the resource exists somewhere else or may return in the future, use a
404. Otherwise, if you are certain that the resource will not make a reappearance, you can use a
410 Gone status example
To get a better understanding of when a
410 Gone status could be used, consider the following example. Let's say a company is running a promotional, limited time offer for a particular product. A page is created for that promotion which is valid for 30 days. However, once the 30 day promotion is over the page is taken down. If the company is sure that the same promotion will never be run again, they may use a
410 Gone status for that page. Therefore if any other website has linked to that page during the promotion period, any visitors will see that the page returns a
410 error, therefore the link should be removed.
410 Gone status isn't as commonly used as other
4xx status codes, however, it does have its uses. If you are going to use a
410 status on a particular resource/page, simply ensure that you want to permanently remove said page. Otherwise, if there is a possibility that the page will be available in the future, it is better to make use of the