Redirect blogger 404 Error to Homepage:blogger customization
When a user of you blog comes to you blog from search engine and the link indexed to search was deleted by the admin. Here arises the problem that the he will be getting a 404 error (page not found) this impose a negative impression to the user. "Sorry, the page you were looking for in this blog does not exist".
For resolving this issue of 404 error (page not found) you can redirect the page to your home page. By this small snippet of code you can redirect the use to your blog home page or the page you want display of your choice. One of the way to redirect the page is meta refresh, with this there is small problem that is it breaks the navigation. Here we will use JavaScript technique to resolve this issue. It is good and best to include such a small statement that “The page you are looking to is not found and you will be redirected to home page shortly” By this redirection message the user gets some home hope that something is going to displayed shortly. And user will not be cheated here because he won’t get disappointed if the search results don’t match.
This how you have to design your 404 redirection code :
1.Go to Settings > Search preferences > Custom Page Not Found (under Errors and redirections).
2.Click Edit and paste this with out inverted commas:
"Sorry, the page you were 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>"
![]() |
4. You can increase or decrease the time from 5000 milliseconds.
5.Click on save.
Make a test this works perfectly.
No comments:
Post a Comment