Breaking News
Loading...
Sunday 10 November 2013

404 Error: How to Redirect 404 Error Page (Page Not Found) To Homepage in Blog of Blogger

404 Error: How to Redirect 404 Error Page (Page Not Found) To Homepage in Blog of Blogger
Whenever, by mistake, we or a user misspells an URL inexistent in our blog, it automatically redirects to the404 error page (page not found). A message like this could appear:

"Sorry, the page you were searching for during this blog doesn't exist.
You will be redirected to homepage shortly."

And probably this may not create a good impression on the greatest potential users of our blog. Before the user clicks the rear button or close the window/browser's tab, therefore effort our website forever, we may want to send 404 error in Blogger to a page, wherever ar probabilities that the visitor can continue reading our blog.

One of the foremost used ways is that the "meta refresh" however the matter with this technique is that it breaks navigation (doesn't allow returning back). during this case, the simplest technique is by mistreatment Javascript which will be shown below.

Also Read: Create Professional 404 Error Page in Blog of Blogger

REDIRECT BLOGGER 404 ERROR WITH JAVASCRIPT

First of all, go to your Blogger dashboard and then to Settings > Search preferences > Custom Page Not Found.
404 Error: How to Redirect 404 Error Page (Page Not Found) To Homepage in Blog of Blogger

Copy and paste the following code:

Sorry, the page you were searching for during this blog doesn't exist. <br />
You will be redirected to homepage shortly.
<script type = "text/javascript">
//BlogofBlogger.com 404 Redirect
JN_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
</script>

The message which is going to be displayed can be edited as you want. 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 / with the url of your page. And finally, the number 5000 is the delay expressed in milliseconds. You can edit any value if this is more convenient.

Next thing to do is to save all changes made in this section and do a little test to check if the code works well. You can enter a nonexistent URL on your blog, and see if the 404 error page added previously appears, followed by a redirection after 5 seconds. That's it!

You Also Like:

How To Rename Labels in Blog of Blogger?

0 comments:

Post a Comment

 
Toggle Footer