Portal of all Blogger widget, Airtel USSD Codes, Facebook Hack, Free Internet Tips, PC and Blogger Tricks

Breaking

Wednesday 21 May 2014

How to Prevent Blogger URL Redirecting toCountry Specific URL

Dear Allin1web readers I think you all know that blogger URL redirect automatically to Country Specific URL. Blogspot redirects user’s blogs to a country-specific domains. For example, if you’re in Australia and viewing [blog name].blogspot.com, you might be redirected to country specified URL. Selective censorship is the main reason in redirecting blogspot’s blog to a country-specific domain.

Some negative impact of country based domain are-

1. The social stats – or Facebook Likes, Google +1s and Tweet counts – for your blog stories may be diluted as the URLs for the same story become different from different visitors.
2. You will have a similar problem if
you are using an external commenting platform like Disqus or Facebook Comments.
3. Also, if canonicalization isn’t
implemented properly, it may cost you some Google juice as external websites may link to your country-specific pages.

  • How to do- Disable Default Regional Domain Redirection
1: Login to your blog, inside the
Blogger Dashboard and choose Template.
2: Then click the “Edit HTML” button and click “Proceed” when asked.
3: Now copy-paste the following code into the template after the <head> tag.
<script type='text/javascript'>
      var blog = document.location.hostname;
      var slug = document.location.pathname;
      var ctld = blog.substr(blog.lastIndexOf(&quot;.&quot;));
      if (ctld != &quot;.com&quot;) {
        var ncr = &quot;http://&quot; + blog.substr(0, blog.indexOf(&quot;.&quot;));
        ncr += &quot;.blogspot.com/ncr&quot; + slug;
        window.location.replace(ncr);
      }
    </script>

4: Click the Save Template button and now your Blog will always serve with the blogspot.com URL.

No comments:

Post a Comment

Notice: Don't add "backlink". Text with Link will automatically Removed.