Pages

Monday, June 25, 2012

How To prevent Country Specific URL Redirect For Blogger


Early last month in February Google started redirecting all blogs to local country code Top-Level Domain (ccTLD), the blogs which are hosted on Blogger.com and using free BlogSpot sub-domain. For instance if you visit example.BlogSpot.com from India (or using any Indian IP address) then it will get redirected to example.BlogSpot.In or if you visit from UK (or by using any UK IP address) then it will get redirected to example.BlogSpot.Co.UK.
Till now it live in around 15 countries mention below:
Argentina (blogspot.com.ar), Australia (blogspot.com.au), Brazil (blogspot.com.br), Canada (blogspot.ca), France (blogspot.fr), Germany (blogspot.de), India (blogspot.in), Italy (blogspot.it), Japan (blogspot.jp), Mexico (blogspot.mx), New Zealand (blogspot.co.nz), Portugal (blogspot.pt), Spain (blogspot.com.es), Sweden (blogspot.se), UK (blogspot.co.uk)


It is happening so that Google can easily block the content which is not appropriate for a specify country according to the law of that country and can easily server that same content in other country without any issues.
To get out of this problem follow these steps. It will help you a lot...
Just go to Blogger Dashboard –> Design/Template –> Edit HTML and then add this below code just after starting <head’> tag
<script type='text/javascript'>
if (document.location != '<data:blog.canonicalUrl/>'){
var dom = document.location.hostname;
var path = document.location.pathname;
var dot = dom.split(".");
var ex = dot[2];
var ex2 = dot[3];
if (ex != "com" || ex2 != null){
var name = dot[0] + ".blogspot.com/ncr";
window.location.replace("http://" + name + path);}}
</script>
And Google has also remove their default 404 error page form all Blogger blog and started showing current template of that blog with this error message “Sorry, the page you were looking for in this blog does not exist.” so that people can easily redirect their blog to blogspot.com domain using JavaScript.
With this code you can easily redirect your blog from any country domain to .com ....
Enjoy!!!!!!!!

2 comments:

Saket Jajodia said...

Please delete this copied post or else I need to file a DMCA..

Unknown said...

very useful and interesting post

SEO Portugal

Post a Comment