How to Create and Redirect a 404 Error Page to Home Page in Blogger

Blogging Tips & Tweaks Tips & Tweaks

There is no how you try to avoid errors in your blog that users won’t create one for themselves. Forgive me if I say there are more than a million yet to be pulled up errors in your blog than you know it. When I say pulled up errors, I mean error pages in your blog that your blog visitors just seem to pull up every now and then whenever they try to access a page which is not listed in your blog or a page that has been deleted from your blog. Such error pages are referred to as the 404 Error Page.

As you know by now, the default 404 error page is the same for all Blogger powered blog. If you want to make your blog more different from other blogs, then you need to be ready to customize every default features that Blogger has got to offer to make your blog stand out as being unique. This is why I am going to show you how to setup a unique 404 error page for your blog which will appear completely different from the default Blogger 404 error page. To achieve this, we are simply going to add script in the Custom Page Not Found box. Just make sure you do not miss any part and also try to ask question using the comment section below the post in case you get stuck along the way.

404 Error Page Which Redirects to Homepage or Another Page

When you add this 404 error page to your blog, users will be redirected to your blog’s homepage or another page you specify once they try to access a page which is not listed in the blog or has been deleted from the blog. If you like this, then here is how to add it to your blog;

404 errors and redirection in Blogger

  • Locate the Errors and Redirections section and click Edit just in front of Not Set for the Custom Page Not Found.

404 error page and redirection for Blogger

  • Next copy the code below and paste into the box that will be provided for you to enter the Custom Page Not Found code.
This page doesn’t exist on our blog.

Patiently wait as you are redirected back to our Homepage.

<script type = "text/javascript">

BSPNF_redirect = setTimeout(function() {

location.pathname= "/"

}, 5000); 

</script>

Customization:

  • If you want to change the message that comes with the 404 error page that will be created when you add the above code to your blog, simply change the text This page doesn’t exist on our blog. Patiently wait as you are redirected back to our Homepage.
  • To redirect the 404 error page to another page instead of the Homepage in your, change pathname in location.pathname= “/” to href and then add the URL of the page to replace the / which is inside the quote in location.pathname= “/”.
  • By default, the code instructs the 404 error page to automatically start redirect in 5 secs after the page must have completed loading. If you to change the time it will take the 404 error page to redirect to the homepage or another page, simply change the value 5000 in the code above to whatever time you want.

To check whether the 404 error page you have created works, just enter something like thisiserrorpage after your blog’s URL and hit enter i.e. something like www.yourblog.com/thisiserrorpage.

Leave a Reply

Your email address will not be published. Required fields are marked *