toolbar free news,sports,technology,health,economy,politics: Stop Redirecting your Blogger Blog to Country Specific URLs

Translate

Sunday, March 25, 2012

Stop Redirecting your Blogger Blog to Country Specific URLs

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 onEdit HTML button and click on proceed.
Step 2:- Now Copy the Below Code and paste it after the <head> tag.
<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 >hackillution

1 comment: