How Redirect 404 Page Not Found to Blog Home Page in Blogspot

MD M Nauman Sunday, 2 April 2017 0 comments

    Two Ways To Redirect 404 (Page Not Found) to Home Page in Blogger

    Learning What is 404 Error Message?


    What is 404 Error Page ?

    404 Error Message is a HTTP Response Code It Indicates that The Client was able to connect to the sites Server But The Server Does not find What Client Requested. As We All Know Our Blogger Sites are hosted by Blogger itself. So Blogger Generates Default 404 Error Message to the Client. In Simple Words When you Create a Post and for Some Reasons You delete the Post But when Your Subscribers or Readers Go to That Deleted Post Then Server Will Show the Default 404 Error Message. but the default message is not Good in looks and attractive. 

    Why Redirecting All 404 Pages to Home Page is Not a Good Practice ?


    404 Error Message is an Error Message Displayed by Sites Server When Some pages, posts are broken or deleted or changed So If you Redirect your 404 To the homepage without knowing your visitors Simply Redirecting your non existent pages is not a good practice From SEO Point of view. But If you have a Single page Site Then many developers forget to add 404 page to it then you can redirect it to homepage.

    First Method: We Will Redirect using Meta Tag:

    STEP 1: Log in to your Blogger account and Go to your Blogger Dashboard

    Template

    STEP 2: In The Left Side Bar You will find Template Section as highlighted in the image above Click on Template.

    STEP 3: Click On Edit HTML.

    STEP 4: After Clicking on Edit HTML Search for
    <head>

    STEP 5:  Copy This Below Code just after <head>

    <b:if cond='data:blog.pageType == &quot;error_page&quot;'>
    <title>Page Not Found - <data:blog.title/></title>
    <meta content='5;/' http-equiv='refresh'/>
    </b:if> 

    Customization:

    • The Yellow Highlighted 5 is Responsible for time to take before redirection means after 5 seconds 404 Error page will redirect to Your Site's Home page. So you can change it increase or decrease according to your desire.
    STEP 6:  All Done Save the template and Check it in your site.

    Second Method: We Will Use JavaScript to Redirect 404 Pages to Home Page:


    STEP 1: Log in to your Blogger account and Go to your Blogger Dashboard


    STEP 2: Now go to Settings-> Search Preference -> As Shown in the Image Below


    STEP 3: Now Under Errors and Redirections Section Go To Custom Page Not Found click on Edit As Shown  in the Image Below:



    STEP 4:  Now Paste The Below code in the box if you already have custom 404 page set then don't replace the code add this script tag at the end after your 404 Code then Click on Save Changes.
    <script type = "text/javascript">
    BSPNF_redirect = setTimeout(function() {
    location.pathname= "/"
    }, 5000);
    </script>

    Customization:

    • The Yellow Highlighted Text 5000 is Responsible the seconds before redirection this 5000 milliseconds means 5 seconds means after 5 seconds 404 Error page will redirect to Your Site's Home page. So you can change it increase or decrease according to your desire

    STEP 6:  All Done Save & Check it in your site.

    That's It Thanks For Following our Tutorial ''Two Ways To Redirect 404 (Page Not Found) to Home Page in Blogger'' Along With us If you found any difficulty Please Comment and Share Your Valuable Opinion. And Stay tuned for More Tutorials Like This and Share this with your friends.


    Labels:

    Hello MD M Nauman is a passionate Web Designer and write Reviews on Games and Software. He love blogging, Designing Blogger templates, Web Developing.

    Google+ Pinterest

    0 Comments to How Redirect 404 Page Not Found to Blog Home Page in Blogspot Post Yours! Read Comment Policy ▼