Total Pageviews

August 21, 2012

Prevent your Blogger Blog from Redirecting to Country-Specific URLs

 
 

Sent to you by rak77 via Google Reader:

 
 


Google, as most would know, redirects Blogger blogs to country-specific domains. For instance, if you open example.blogspot.com in your browser, you might be redirected to example.blogspot.in if you are located in India or to example.blogspot.com.au if you access the same blog from Australia.

The main reason why Google implemented country-specific redirection is selective censorship – they can now easily block a blog, or a particular page on a blog, in one country but still serve it in other regions.

blogger countries

Blogger and Country-Specific Domains

My traffic logs suggest that country-specific redirection in Blogger is now live in at least 15 countries. Here's a complete list:

India [blogspot.in], Australia [blogspot.com.au], UK [blogspot.co.uk], Japan [blogspot.jp], New Zealand [blogspot.co.nz], Canada [blogspot.ca], Germany [blogspot.de], Italy [blogspot.it], France [blogspot.fr], Sweden [blogspot.se], Spain [blogspot.com.es], Portugal [blogspot.pt], Brazil [blogspot.com.br], Argentina [blogspot.com.ar], Mexico [blogspot.mx]

Prevent Blogger from Redirecting to Country-Specific Domains

This country based URL redirection does mean some negative consequences to your Blogger blog. For example:

  1. The social stats – like 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.

If you are not happy with the idea of Blogger redirecting your blog to a different URL, you can add the following piece of code to your Blogger template and it will always serve the .com address to your visitors irrespective of their geographic location.

Go to your blog inside the Blogger Dashboard and choose Template. Then click the "Edit HTML" button followed by "Proceed." Next, 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("."));  if (ctld != ".com") {  var ncr = "http://" + blog.substr(0, blog.indexOf("."));  ncr += ".blogspot.com/ncr" + slug;  window.location.replace(ncr);  }  </script>

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

This simple script parses the domain name (document.location.hostname) of your blog page and if it includes a country-specific URL (like blogspot.in), it will force-redirect the visitor to the blogspot.com address using the /ncr switch.

Tweet this Share on Facebook


Digital Inspiration @labnolThis story, Prevent your Blogger Blog from Redirecting to Country-Specific URLs, was originally published at Digital Inspiration on 22/03/2012 under Blogger, Internet.

Related posts:

  1. Prevent OpenDNS From Redirecting Google Searches – Fix for Firefox & IE Address Bar
  2. Backup Your Blogger Blog in a Click
  3. Find Images from a Specific Country with Google
  4. One Can Leave His Blog URL in Blogger Comments Even With OpenID
  5. Okay, Here's Why Google is Redirecting your Blogger Blogs


 
 

Things you can do from here:

 
 

No comments:

Post a Comment

If you really like my post, please leave your valuable comments/feedback for improvement:

h