Hello Friends, In the previous post we had learnt about
setting a custom 404 page for our blogs and in this post we will learn how to
auto redirect our 404 pages to the homepage. We will be using a short
javascript code for redirecting the 404 pages to homepage after displaying a
custom 404 page. A custom 404 page makes your blog more user frindly because it
lets you show a custom message when ever a user come accross a URL that is not
present in your blog or has been shifted.
Recommended Articles:
How to add a redirect in 404 page in blogger:
- Login in to your Blogger account.
- Navigate to your dashboard and click on Settings.
- Click on “Search Preferences” as shown in the image below.
- Now add the following JavaScript code in the box highlighted in red in the image below.
<script type = "text/javascript">
JN_redirect = setTimeout(function() {
location.pathname= "/";
}, 5000);
</script>
- Now click on save and you are done.
You have successfully added a redirection in your 404 error
page. Now, whenever a user come across a url that is not present in your blog
will be shown 404 page and will be redirected to your homepage.
I hope you enjoyed reading this blog post, You can check out
more blogging and SEO related articles in our blogging tips and tricks section.
If you like my work; you
can show your regards by hitting Facebook
like button, following us on Google+ or Twitter, stumbling our posts on
stumble upon or giving us a link back via the links below. Stay tuned
for more update.
Do you like this post? Please link back to this article by copying one of the codes below.
URL: HTML link code: BB link code:
No comments:
Post a Comment