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.

I love sharing my knowledge with others. Feel free to contact me with any questions you may have. Please subscribe to the newsfeed and get updates through email, share this article with friends, or leave a comment below. New users can read about me HERE

Share this on:Share on Facebook2Tweet about this on Twitter2Share on Google+1Pin on Pinterest0Share on StumbleUpon1Digg this

Comments

  1. hi, what if I just type my blog addres in there?

    isn’t it redirect?

    please answer

    thank you

  2. elusoji sodeeq says:

    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.

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

Tell us what you're thinking...

All comments are moderated.

* Denotes required field.

*