How to Auto Redirect from 404 Page to Home Page ?

Redirect all 404 Error Pages to Home Page or to a Static Page in One click

Hello Bloggers , Today in this post am gonna share a script which will auto redirect your website users to homepage, You need not add redirection for every link just you have put one script and it will do the rest. So Read the Post Completely, So that you won't get any issue while installing the Script.

 

How to Auto Redirect from 404 Page to Home Page ?
How to Auto Redirect from 404 Page to Home Page ?

It is undeniable that broken links on blogs can be admittedly quite difficult to overcome. The causes can vary, ranging from the negligence of the blog admin who misplaces or writes links in other articles, has deleted the related link.

Or it could also be caused by search engine crawling that mistakenly translates the URL of the article on the blog.

Well, this error URL can be optimized in a special way. Namely by redirecting it to the blog homepage or to a specific page. 


How to Auto Redirect All 404 Error Page to Home Page?

Step 1. First Login to your Blogger Dashboard 

Step 2. Go to Themes Section and Click On Edit HTML

Step 3. Find </body> or & lt;!--</body>--&gt;&lt;/body&gt; and place the below code
<b:if cond='data:view.isError'>
<script>
window.location.href = &quot;<data:blog.homepageUrl/>&quot;;
</script>
</b:if>

Step 4. Done ! Click On Save.

Note: If you want to redirect to somewhere else or If its not redirection correctly then use the below code.

<b:if cond='data:view.isError'>
<script>
window.location.href = "https://www.spiderbloggingi.in/";
</script>
</b:if>

Conclusion  

Its quite tough to find all broken links and to make it correct so in that case the above code will be useful for you, If you face any issue any in installing the code the please comment below I will try to solve your issue.