Automatically Redirect 404 Error Page to Homepage

How to Redirect 404 Error Page Automatically to Homepage

There are a lot of things about the 404 error page, today we will discuss what exactly means of 404 error page? and How to Redirect 404 Error Pages to Homepage on Blogger. But first, we will know what is meant by 404 Error Pages?

What is 404 Page?

Error 404 page is a static page that indicates warnings in the form of "Page Error 404", "Page Not Found" and which means to notify that the page that is accessed is no longer available. Typically, a 404 page appears when our URL entry is incorrect or the webpage has been removed. Because the URL is still indexed in Google search results or it could be due to URL changes made by the website owner after updating the page.

What is 404 Page and how their impact on SEO

That's why a blog or website has a page or landing page specifically for error 404 pages by providing information that the destination page has been deleted or does not exist.

Well, now I will share an advanced method to redirect 404 error pages automatically to the homepage so that your blog can achieve the best SEO score.

How to Redirect 404 Error Pages automatically to the Homepage.

  • Open Blogger.com
  • Sign-in into Blogger Dashboard
  • Select the Theme menu
  • Click on Edit HTML
  • Now Copy the following code and paste it just Above/Before </body> tag.
/* www.dgntemplate.in */
<b:if cond='data:blog.pageType in {&quot;error_page&quot;}'>
<script>
setTimeout(function () {
window.location.replace("<data:blog.homepageUrl/>");
    }, 8000); //The redirection function will start after 8 seconds.
</script>
</b:if>
The above code will automatically redirect the 404 error page to the homepage after 8 seconds. You can set a waiting time by changing the marked number. 1000 = 1 seconds.

Now click Save Theme button

# If you want to redirect immediately, use the following code.
/* www.dgntemplate.in */
<b:if cond='data:blog.pageType in {&quot;error_page&quot;}'>
<script>
setTimeout(function () {
window.location.replace("<data:blog.homepageUrl/>");
    });
</script>
</b:if>
Or
/* www.dgntemplate.in */
<b:if cond='data:blog.pageType in {&quot;error_page&quot;}'>
<script>
window.location.replace("<data:blog.homepageUrl/>");
</script>
</b:if>
# If you want to redirect the 404 error page to another page instead of the homepage, replace <data:blog.homepageUrl/> with your page URL where you want to redirect.

Conclusion

That's it, An advanced method to redirect 404 error pages to the homepage in blogger, by following this tutorial you will be able to do an automatic redirect for all URLs so that if there are dead links in the blog will automatically be redirected to the home page. I hope you like this tutorial. Stay tuned with us for more interesting blogger tips.

0 Comments

Don't miss the latest template notification from Dgntemplate