Introduction

In programming, sometimes you can face different types of errors in your codes. Some common errors that usually occur are the famous 404 and 410 Errors. Thus, it is very important to understant the difference between these two Errors. In this article, we are going to expantiate more on these Errors.404 and 410 status Errors are to specify that a page does no longer exists. However, 410 is for pages that you deleted, and do not intend to recreate them. On the other hand, you can use 404 to specify that a page is not available. In the latter, it could be a typo mistake or a page that you intend to recreate later. The purpose of this article is to discuss how Search Engines treat both error status. We will also see how you can configure them on your website. Finally, we will talk about the advantages of using one compared to the other.

What is the 410 Error page and how to set up?

The 410 Error page specifies that a page is gone forever, it no longer exist. In order words, if you have a page that will no longer exist, you can use the 410 gone pages. The 410 error page is to specify that a page is permanently removed and will not come back. I will probably recommend the 410 Error page to eCommerce businesses or companies that run websites with URLs that are continually changing.Setting up the 410 Gone pages may vary depending on the server you have. But, if you are hosting your web site on a server that supports the .htaccess file,  you can configure your 410 gone pages with the following code.
  • You need to add this small code to your .htaccess file.
Redirect gone /path/to/folder/
ErrorDocument 410 default(or 410 file)
In the code above, "/path/to/folder/" represent that folder or absolute URL that you permanently deleted. For example, if you removed the page website-development, which is like https://www.prositeweb.ca/website-development, you can replace the /path/to/folder/ by /website-development. Moreover, the "default" in the second line will display the following message:

Gone

The requested resource /website-development is no longer available on this server, and there is no forwarding address. Please remove all references to this resource.As you can see, the message is not formatted or uniform to your website. But with a little customization and styling, you can create an excellent looking 410.php(.html or whatever you want) page. Once you do that, instead of "default" in the second line, you can add the path to the page you created.

What is the 404 Error page and how to set it up?

I believe most of us are used to 404 Error pages, as you may have seen it once or twice on a website. It just specifies that a page is not available. There are many options when a page is redirected to a 404 not found:
  • The page might no longer exist.
  • You may have added the wrong URL to the anchor.
  • The website administrator could have deleted the page temporarily.
It is also essential to configure the 404 not found page so that your visitors will not fall on a blank page when an error occurred.  For the 404 not found page, many CMS already have an easy way that users can use. For example, if you are using WordPress, you need to create a 404.php file and add it to your template. To use the .htaccess to set up your 404 not found page, add this code to your .htaccess file (CMS may have different approaches).ErrorDocument 404 /errordocs/404.htmlIn that line of code, 404.html represents pieces of information that will be displayed if your visitors land to a not found page.

How do Search Engines like Google handle 404 or 410 pages?

According to John Mueller, who is the senior Webmaster Trends Analyst at Google, Google handles the 410 and 404 error pages the same way. It is an extract of the advice that he gave regarding the way to handle 404 and 410 status. The block of the article below is from Search Engine Journal:"If a 404 error goes to a page that doesn't exist, should I make them a 410?"John Mueller answered: "From our point of view, in the midterm/long term, 404 is the same as a 410 for us. So in both of these cases, we drop those URLs from our index.We generally reduce crawling a little bit of those URLs so that we don't spend too 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. But usually, we're talking on the order of a couple of days or so.So if you are removing content naturally, then that's perfectly fine to use either one. If you've already dismissed this content long ago, then it's already not indexed, so it doesn't matter for us if you use a 404 or 410." 

Conclusion

If you intend to delete a page permanently, you can use the 410 Error page. That can reduce a little bit the number of the crawl of those pages. But for pages that you delete temporary, 404 is probably better.Thanks for reading this article. If you have questions or you need help to set up your 410 error page, please, contact us.