Pin It

Widgets

How to Redirect 404 Error Page to Homepage in Blogger

404 error page (Page Not Found) is part of every website and blog. According to Wikipedia, "The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested."

Redirect-404-Error-Page-to-Homepage

A non existing page on a website/blog will result to a 404 error page and this might give first timer a wrong impression about your blog. So the best solution to this type of situation is to redirect your blog 404 error page to your blog home page or a certain page on your blog. This can be done by adding a simple piece of JavaScript code to your blog. Follow the procedure outlined below to redirect your blogger error 404 page to homepage.

==> Log in to your Blogger Dashboard, then go to Settings >> Search Preferences >> Custom Page Not Found (Under Errors and redirections).

404-error-page-settings

==> Click on edit, paste the code below into the box and then Save changes
Sorry, the page you were looking for in this blog does not exist. You will be redirected to homepage shortly.
<script type = "text/javascript">
//Blogger 404 Redirect v1.0 by Olusegun(Justnaira.com)
JN_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
</script>

Customizing the Redirection Code


  • • You can change the message on the top (i.e. Sorry, the page you were looking for in this blog does not exist. You will be redirected to homepage shortly) to anything you like
  • • The 5000 in the code represents delay in milliseconds. You can change the 5000 to any value. Changing the value to zero simply means your 404 error page will be redirected to your homepage or any desired page without any delay.
  • • If you are willing to redirect your blog 404 error page to another page other than your home page, just replace pathname to href and / to the url of the page.


Stay Informed, Inspired and Motivated With Our Free Daily Tips. Add Your Email Now, Don’t Worry, Your Email Address Is Secure:
Enter your email address:

Confirm Your Email Address After Subscribing
We hate spam just as much as you do.


Enjoyed This Article? Follow us on Facebook or Twitter or add us to your circle on Google+ for our new updates.

2 comments so far. What are your thoughts?

mashalive said...
Reply To Comment

Thanks a lot for the tutorial, it has simplified things for me
Jobs

Elusoji Sodeeq said...
Reply To Comment

hi mr Fapohunda.i rily like your posts and tutorials.. you have really bn an inspiration to me..av bn followin your site sins 2011 but av not bn able to set up my.but now am ready.d site is Sdknaija.blogspot.com..thanks for d inspirational and educating information.

Click Here to Leave a Comment

Don't just read and walk away, Your Feedback Is Always Appreciated..

Note:
Please do not spam, spam comments will be deleted immediately upon review.

Like US on Facebook