Tuesday, April 16, 2019

How To Redirect 404 Error Page To Homepage In Blogger

How To Redirect 404 Error Page To Homepage In Blogger

How To Redirect 404 Error Page To Homepage In Blogger
At the point when any reader goes to your blog and out of the blue does not get the searched post then error 404 (Page not found message) happens and a message appears on page "Sorry, the page you were searching for in this blog does not exist." of course. This may be a chance of losing a blog reader. Because just a few readers will think to move at home page or utilize the search bar to search that particular substance on your blog. I am certain many of readers will close the window and move again to search results.

If Page to Found Redirect Reader to the Homepage

Before you lose an opportunity to make another reader for the blog you ought to redirect to a reader to the homepage when goes to a nonexisting page or post of your blog. There are already few solutions available for redirecting a user to the main page or home page, one the strategy is JavaScript and other is meta revive/redirection. I personally don't care for adding more JavaScript to blog because it hinders the blog and diminishes the blog performance. So for auto-redirecting Blogger Page not found (Error 404) page to the homepage, I am utilizing meta invigorate tag because it will load in the template just when any reader reaches to a non-existing page or error 404 happens and does not diminish the blog performance.

This code has 3 parts –

Blogger error pageType tag
Meta refresh tag
Custom Error 404 (Page not found) message
1. Blogger error pageType tag

<b:if cond='data:blog.pageType == &quot;error_page&quot;'>
.....
//some code here
.....
</b:if>

2. Meta refresh/ redirection tag

<meta content='5;URL=https://your-blog-url' http-equiv='refresh'/>

3. Custom error 404/ page not found message

Oops! Page Does Not Exist. We are redirecting you to home page.
Now a complete code of error page is:
    <b:if cond='data:blog.pageType == &quot;error_page&quot;'>
    Oops! Page does not exist. We are redirecting you to home page.
    <meta content='5;URL=http://your-blog-url' http-equiv='refresh'/>
    </b:if>
Note: You must change http://your-blog-url with your blog URL.

How use this code in Blogger template?

    1. Go to Blogger Dashboard › Select a blog › Switch to Template tab › Edit HTML
    2. Now search for <head> tag
    3. And paste error page code just below head tag
    4. Save the template › Done
    5. You can test the error page code is working by opening following URL.
https://your-blog-url/404
Note: You must change your-blog-URL with your blog URL.

Steps to Redirect 404 error page to the homepage in blogger?


Step1: Go to www.blogger.com

Step2: Sign in with your Google Account

Step3: Go to Settings >>Search Preferences
How to redirect 404 error page to the homepage in Blogger
Also, you need to login on blog account and redirect 404 error URL to others.
  • Login on your Blogger/Blog Account.
  • Go on DashBoard.
  • Click on Settings.
  • Click on Search preference.
  • See Custom Redirection and Edit it.
  • In first box paste copied URL (which is not indexed) and in other box paste URL where you want to redirect this error.
Congratulations: You have successfully fixed Blogger post returning 404 errors by redirecting it to the homepage. You can open the URL and instead of showing not found the error it would take you to your homepage.

If you have a lot of 404 Errors on your site, then Instead of moving all not found URLs one-by-one to the homepage it would be better to use our 404 to Home Plugin that automatically redirects visitors to the home when they access a not found page. We hope that this article would help you with resolving posts returning 404 errors in Blogger. Did this process work for you? Do you have a better suggestion for us? Please, feel free to leave your suggestions below., if You Have Any questions or suggestions, please comments your opinion 

Happy Blogging! :)

No comments: