Stop Redirecting your Blogger Blog to Country Specific URLs

From January last week, google redirects all blogger blog to their local url/country specific url, This redirection is called “country-code Top Level Domain” (ccTLD), for example: if anyone visit this blog http://[blog-name].blogspot.com from India then it auto-redirect to the http://[blog-name].blogspot.in and if visited from UK then it redirect to http://[blog-name].blogspot.co.uk.

Why Blog Redirect to a Country-Specific URL:-

The main reason to implement ccTLD is to manage content locally or in simple we can say that for censorship, for example:- if you post any content which is against to any Government, Organization etc, so google will easily block that particular url on that country, but other countries still access that url.

Country-Specific-Domain-ccTLD-Blogger-blog

How to Stop/Disable Country Specific Domain(ccTLDs):-

Step 1:- Go to Blogger Dashboard and click on Template and then click on Edit HTML button and click on proceed.

Step 2:- Now Copy the Below Code and paste it after <b:include data=’blog’ name=’all-head-content’/>.

<script type=”text/javascript”>
var str= window.location.href.toString();
if ((str.indexOf(‘.com/’))==’-1′) {
var str1=str.substring(str.lastIndexOf(“.blogspot.”));
if (str1.indexOf(‘/’)==’-1′) {
var str2=str1;
}
else {
var str2=str1.substring(0,str1.indexOf(‘/’)+1);
}
window.location.href =window.location.href.toString().replace(str2,’.blogspot.com/ncr/’);
}
</script>

Step 3:- Save your Template and check your URL.

How it Works:-

As google explains any one can view the .com version by simply add ncr(no country redirect) at the last of URL, for example:- http://[blog-name].blogspot.com/ncr will always served as the .com version of the blog.

So in the above java script code we temporarily prevent Blogger Blog to redirecting their local url or country specific url by simply using No Country Redirect(NCR).

[Source:- Tech Stumps]

About the Author

I'm Shubham Yadav, B.Tech(I.T) Graduate from Behror, Rajasthan. You can follow me on Twitter. You also subscribe to Hack Illusion Feed via RSS or Email.

8 Comments so far. Feel free to join this conversation.

  1. Ranadheer March 25, 2012 at 4:39 am - Reply

    But Still again redirecting again
    And a Doubt should we paste the code right after or else the line below it

    • shubham March 25, 2012 at 9:27 pm - Reply

      Again checked the above code and paste it on just after tag and it is working fine. Again copy the above code and paste it and tell me is it working or not and also tell your blog name.

      • Ranadheer March 25, 2012 at 11:32 pm - Reply

        http://www.ranahacks.blogspot.com
        i will report again after trying thanks for the reply

        • shubham March 26, 2012 at 1:09 am - Reply

          Try to paste the above code just after <b:include data=’blog’ name=’all-head-content’/> and tell us

  2. reetha March 25, 2012 at 10:45 pm - Reply

    this code is not working till its redirecting into .uk or .in

    • shubham March 26, 2012 at 1:10 am - Reply

      The above code is working well, Paste the above code after <b:include data=’blog’ name=’all-head-content’/> in head section.

  3. Ponmalar April 7, 2012 at 5:21 am - Reply

    This code created by me only. I take 3 hours to make this javascript code. If you backlink to my post , i would be happy. http://www.techstumps.com/2012/03/stop-blogspot-redirect-country-specific.html

    • shubham April 10, 2012 at 1:44 am - Reply

      Hi Ponmalar, I received this code from my blogger friend, SO i don’t know from where he got this code. BTW i’ll give credit to your post.

Leave A Response

CommentLuv badge