How to Redirect 404 Not Found Page to the Home Page in Blogger

Advertisements
Whenever a person lands on a web page that is either deleted or has no existence Blogger blogs usually display its common 404 not found error message i.e. “Sorry for the inconvenience, the page you are looking for has no existence”. First impression counts more than anything. A person would never desire to display not found error pages to his new visitors. Therefore, it is essential to redirect all 404 not found pages to the home page so users can easily get access to the content that is waiting for them. Since, Blogger do not support PHP, so we have to make use of JavaScript that does the job pretty nicely. Therefore, today in this article, we will learn How to Redirect All 404 Not Found Pages to Homepage in Blogger.

Before, we get on with our tutorial. Let us first discuss the true definition of not found pages. Most of the webmasters would be well aware of it but some beginners might get confused. Consider the following meaningful definition:

  • 404 Pages: The 404 not found error message is a form of standard HTTP response code, which indicates the client that the destination which he is looking for, is unable to interact with the server or has no existence. 
  • 301 Permanent Redirects:  URL redirection, also known as URL redirecting is a technique that allows a webmaster to forward his one domain to another domain through URL redirection, or making different web page available under many URLs
The Solution:
The solution is pretty much straightforward because there is no rocket science behind this technique. A small chuck of JavaScript coding would be doing the entire job. Consider the following instructions and apply them as mentioned below. 

Go To Blogger >> Settings >> Search Preference. Now from the list of functions Select Custom Not Found Page and paste the following JavaScript coding in the HTML Box. If some folks are using custom 404 error message, than they can add the following code at the end of the coding.

Sorry for the inconvenience, the page you are looking for has no existence.<script type = "text/javascript">
//Blogger 404 Redirect Powered by MyBloggerLab
BSPNF_redirect = setTimeout(function() {
location.pathname= "/"
}, 1000);
</script> 

  • 1000 is the delay time in microseconds. Anyone can change it. Changing the value to Zero (0) would redirect immediately without any delay. 
Save it and that’s it. Now whenever a visitor would hit a 404 page, it would automatically redirect him to your homepage. Note: This technique should be used only if lots of your indexed posts are deleted and they are getting high SERP ranking.  
Advertisements

The Editorial Team of MyBloggerLab consists of a group of Professional Blogger geeks Led by Syed Faizan Ali (Founder of MyBloggerLab).

Comment With:
OR
Choose Wisely!

19 comments

January 30, 2013 at 11:49 AM

Great Post! Thanks for the information Faizan!

January 30, 2013 at 6:16 PM

cool idea bro, thank you for sharing this with us !!


www.pokharatech.com

January 30, 2013 at 7:18 PM

Cool post. THis is something that many people will be looking out for

January 31, 2013 at 12:40 AM

thanl you syed for this. I asked you once and u posted it!! Thanks a lot/
!! :D

January 31, 2013 at 12:41 AM

actually, i m using a custom 404 page. Check: mypremiumtricks.com/404

well, can i add the script after that?

January 31, 2013 at 1:26 AM

@syed faizan ali : please tell me if my blogger site have not any error or 404 error, so it is necessary to add these settings which you told about? Thanks

Editorial Team MOD
January 31, 2013 at 1:57 AM

Yes, you can add the Code there!

Editorial Team MOD
January 31, 2013 at 1:58 AM

No, if you're not getting any errors than there is no need to use this technique!

January 31, 2013 at 7:41 AM

hello syed if i change the value of / in the below line with any blog adress then will it redirect to any other site
location.pathname= "/"

Editorial Team MOD
January 31, 2013 at 8:38 AM

If You Don't Want to Redirect it to Home Page and Desire to redirect to any specific Page than Use This Code:


Sorry for the inconvenience, the page you are looking for has no existence.
<script type = "text/javascript">
//Blogger 404 Redirect Powered by MyBloggerLab
BSPNF_redirect = setTimeout(function() {
location.href= "http://www.mybloggerlab.com"
}, 1000);
</script>

February 1, 2013 at 8:38 AM

Good Stuff Syed! I'm sure we'll see an increase in traffic. Thanks

February 1, 2013 at 11:24 PM

Awesome Post Syed Bro...Keep It Up :D

May 23, 2013 at 1:29 AM

Sorry for off topic. Do you have URL filter in Blogger commenting system? Please tell me.

Editorial Team MOD
May 23, 2013 at 11:07 AM

No, Sometimes it gets filers and sometime it won't. However, keep on marking them as SPAM so that Blogger can recognize Spam comments next time someone leaves the same comment!

May 29, 2013 at 10:37 AM

I think my blog theme does not work. How do I reset operation 404 pages of html theme?
Thank you!

Editorial Team MOD
May 30, 2013 at 12:53 AM

Recent your BLOG Widget located in Blogger Template Editor

May 30, 2013 at 1:51 AM

I added Widget, however does not work. What could be the problem?

Editorial Team MOD
May 30, 2013 at 2:24 PM

You have to add it in Search engine preference area >> Not found

February 8, 2016 at 10:06 PM

Great Tip Work.. my blog 35 404 page and now i follow your post and its work thnaks. bolegapakistan.blogspot.com

Post a Comment

We’re eager to see your comment. However, Please Keep in mind that all comments are moderated manually by our human reviewers according to our comment policy, and all the links are nofollow. Using Keywords in the name field area is forbidden. Let’s enjoy a personal and evocative conversation.

Helping You to do Cool Things With Blogger Since 2012™.

© Copyright 2012 - 2018. MBL Networks, All Rights are Strictly Reserved.