Wednesday, February 4, 2015

HOW TO REDIRECT '404 ERROR PAGE NOT FOUND' TO YOUR HOME PAGE

No blog is perfect in the blogosphere. At anytime Google can show up 404 ERROR PAGE NOT FOUND as it fails to crawl into your blog. A new visitor who sees the message never consider again to come to your site intentionally. So, in order to keep the visitors stick to your blog, it's better to redirect the page showing the message 404 Error to the homepage automatically.
Follow the steps below to redirect error pages to your homepage.
1. Go to the blogger dashboard.
2. Select the Settings from the left side and click on Search Preferences from the drop down.
3. Now you can see an empty box near the option Custom Page Not Found.
4. Copy and paste the following JavaScript to the box.
Sorry, the page you're looking for in this blog does not exist.
You will be redirected to homepage shortly.
<script type = "text/javascript">
BSPNF_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
</script>
5. Save the settings and you are done.
NB: You can tweak the above code yourself. If you want to redirect the error page to some other address then replace pathname with href and with the URL. If you want to change the delay time (in milliseconds) replace 5000 with a convenient number.
I hope this blogger tip will help you to keep in your new visitors.

0 comments:

Post a Comment