{"id":41927,"date":"2014-11-26T14:44:51","date_gmt":"2014-11-26T09:14:51","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=41927"},"modified":"2021-01-03T17:31:19","modified_gmt":"2021-01-03T12:01:19","slug":"http-410-error-pages-htaccess","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2014\/11\/http-410-error-pages-htaccess\/","title":{"rendered":"Setup HTTP 410 Gone Error Status Code with .htaccess Redirects"},"content":{"rendered":"<p>How can you set up 410 Gone Error pages using .htaccess redirects? 410 error is an HTTP server response to signify that the particular webpage is gone forever, is permanently removed from the website, and is never going to come back. It is unlike the more common 404 errors which are displayed when a particular URL cannot be found on the server.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-59107\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-1024x576.png\" alt=\"410 error code\" width=\"760\" height=\"428\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-1024x576.png 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-300x169.png 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-150x84.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error-768x432.png 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-error.png 1280w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/p>\n<h2>\u00a0Setup 410 Gone Error Pages<\/h2>\n<p>The best way to set up the 410 error pages on Apache servers is to call the default 410 HTTP server response. Here is what we added to our<strong><em> .htaccess<\/em><\/strong> file in the root of the server.<\/p>\n<pre><code>Redirect gone \/path\/path\/folder\/\nErrorDocument 410 default<\/code><\/pre>\n<p>Note always keep a backup of <em>.htaccess<\/em> file before editing it as it a very powerful file and can take your site offline if incorrectly configured. It is important you add the path of the content folder and not the full http:\/\/ URL.<\/p>\n<p>So now when you visit these pages, you get the default 410 error page from the server<\/p>\n<p><img decoding=\"async\" class=\"border alignnone wp-image-42010 size-full\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error.png\" alt=\"410 gone error\" width=\"434\" height=\"139\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error.png 434w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error-150x48.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-gone-error-300x96.png 300w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/p>\n<h2>404 vs 410 Errors<\/h2>\n<p><img decoding=\"async\" class=\"size-full wp-image-42018 alignnone\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error.png\" alt=\"410 404 error\" width=\"248\" height=\"197\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error.png 248w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/410-404-error-150x119.png 150w\" sizes=\"(max-width: 248px) 100vw, 248px\" \/><\/p>\n<p>Google considers that <a href=\"https:\/\/webmasters.googleblog.com\/2011\/05\/do-404s-hurt-my-site.html\" rel=\"noopener\">404 and 410 errors are same<\/a> for all practical purpose and they deal with them in a similar manner.<\/p>\n<blockquote><p>Currently Google treats 410s (Gone) the same as 404s (Not found), so it\u2019s immaterial to us whether you return one or the other.<\/p><\/blockquote>\n<p>But I figure that the main difference between the 404 and 410 status code is that while search engine bots keep trying to check if the 404 page is back or not, the 410 signifies the page is gone and possibly is checked less often or possibly never at all in the long run, as it is an HTTP server response which is purposefully created by webmasters for a specific serious purpose, unlike 404 errors which might happen due to any broken link or mistyped URL errors.<\/p>\n<p>If your page is not disappearing from the Google index, do give 410 errors a try. Of course, if you intend to bring the URL back someday, it is always better to use a 404 error.<\/p>\n<h2>How We Use 410 Errors<\/h2>\n<p>Previously you must have read how WordPress theme backlinks led to a massive Penguin penalty on our site. We first <a title=\"How We Removed 1.7 Million BackLinks and Survived\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/09\/removed-million-backlinks\/\">removed 1.7 million backlinks<\/a>, by <a title=\"How to Force 404 Errors in WordPress\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/force-404-errors-wordpress\/\">forcing 404 errors<\/a>, and then decided to <a title=\"What is Better Than Removing 1.7 Million Backlinks!\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/02\/better-than-removing-million-backlinks\/\">301 redirect backlinks<\/a> to a new domain.<\/p>\n<p>But the pages persisted in the Google index search results. The redirects did not cause the pages to disappear in the domain search results, though the pages were non-existent on the server.<\/p>\n<p>Even efforts to remove URLs using the Google webmaster tools failed. A search for the domain reveals this &#8211;<\/p>\n<p><img decoding=\"async\" class=\"border alignnone wp-image-42009 size-full\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links.png\" alt=\"persisting theme links\" width=\"448\" height=\"186\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links.png 448w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links-150x62.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/persisting-theme-links-300x124.png 300w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>But then\u00a0I setup the 410 gone errors for the pages, they have finally disappeared from the domain search results! I do not intend to bring these pages back, and <a title=\"Delete Urls With Bad Backlinks to Remove Google Penalty\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/06\/delete-urls-with-bad-backlinks-to-remove-google-penalty\/\" target=\"_blank\" rel=\"noopener noreferrer\">nonexistent URLs backlinks do not count<\/a> for penalty purposes.<\/p>\n<p>Note removing the redirects and causing 404 errors will also remove pages from the index in a few days &#8211; as broken search results lead to poor search experience for users.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How can you set up 410 Gone Error pages using .htaccess redirects? 410 error is an HTTP server response to&#8230;<\/p>\n","protected":false},"author":4,"featured_media":59107,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,41],"tags":[49],"class_list":["post-41927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-search-engine-optimization","tag-tutorials"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/41927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=41927"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/41927\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/59107"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=41927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=41927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=41927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}