Friday 19 April 2013

Prevent redirecting Blogger Blog to Country Specific URL




Hello Readers, continue posting on Blogging and SEO tips. Unziptech has already shared many useful articles on this topic and this post focuses on the effect of redirection of your Blogger blog url to ccTLD. You must have noticed this thing in past few months that now every blogger blog's url points to its country level url. That means if a person from India try to access your blog with a .com TLD it will redirect to .in ccTLD itself. Google has implemented this thing to maintain the regional censorship on your Blog's content.

Prevent Blogger ccTLD Redirect

Why Blogger URL redirects to ccTLD URL

In past few days Google has become more conscious about the regional censorship over Blog's content. The main motive of this redirect is to remove the censored content of your Blog in your local region. Sometimes you post content on your blog which is against the regional government laws, in that case Google will remove that content from your Blog and you will be contacted by them as well.

How ccTLD redirect affects your SEO

Well, Google is aware of this fact and they are working on this as well that redirecting your Blog's URL to a ccTLD will affect the SEO. Your Blog's content will be available on many ccTLD domains that will degrade your site's SEO. Whenever a user from US try to visit your blog it will add co.us to url and similarly for every country it will happen. It leads to a situation of content duplicity, which we know has a false effect on SEO.

How to prevent redirect to ccTLD

There are a few ways that you can use to prevent this redirect which are as follows:

1) You can go for a custom domain for your blog. Custom domains are not vulnerable of this redirect. You can purchase any custom domain for your Blog from any domain registrar.

2) If you are not able to afford the custom domain cost you can add ncr(no country redirect) at the end of every link (suggested by Google itself) of your blog you mention on your Blog. Which i know is a tiring task. So we have made this thing easy with the help of JavaScript. If you add /ncr at the end of every link it will set a temporary cookie which prevent this redirection. Now let me tell you how you can add this Javascript to your Blog.

  • Take the backup of your blog, so that you can prevent any loss. Go to Blogger dashboard and then template section. Click on Backup/Restore and download your blog's template.
  • Now Click on Edit Template and Expand the Widgets by clicking on expand checkbox (Already checked in new blogger Template Editor).
  • Now search for <b:include data='blog' name='all-head-content'/> by pressing CTRL+F.
  • Just Below this code, add the following JavaScript code, without changing anything:
&lt;script type=&quot;text/javascript&quot;&gt;
var str= window.location.href.toString();
if ((str.indexOf('.com/'))=='-1') {
var str1=str.substring(str.lastIndexOf(&quot;.blogspot.&quot;));
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/');
}
&lt;/script&gt;
  • Now click on Preview to ensure that everything is Fine and you don't have any error in your template. 
  • Click Save and View Blog, it will redirect to .com version of your Blog.
If you have any problem adding this code to your Blog you can comment here. I will be Glad to help you. Check more Blogging and SEO tips on Unziptech.
If you like my work; you can show your regards by hitting Facebook like button, following us on Google+ or Twitter, stumbling our posts on stumble upon or giving us a link back via the links below. Stay tuned for more tech updates.

Do you like this post? Please link back to this article by copying one of the codes below.

URL: HTML link code: BB link code:
author pic
Author: Mohammad Zafar Ahmad
Zafar Ahmad is PHP/Java Developer and a Passionate Blogger. He likes to write about Blogging tips, SEO tips, Blogger Widgets, Smart phones, Tablets and Online Earnings. You can find him on Facebook, Twitter or Google+

No comments:

Post a Comment