Thursday, 21 June 2012

How to avoid Blogger/BlogSpot Blog from redirecting to Country-Specific domain name - Technology Times


Some of you might have observed that you gave a request of .com extension but it is always sending .in (your geographical location URL). As most of the people might have observed that the blogger redirects to the country’s specific domain name/URL from past few months so this may lead to some of the problems to your blog traffic and other problems like making your blog distinct on the basis of geographical search results.  So to avoid such issues one can use the following java script directly inside your blogger EDIT HTML section for any of irrespective of the template you are using.

<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>


This code should be copied as it is written and must be placed after <head> tag in the same upper said HTML EDIT section.


Why did Google choose this methodology?

Well, with the introduction of this redirection, it can now easily distinguish the traffic and thus can block a blog easily in some cases.  Similarly, your social site network can have more filter regarding the apps you are using inside your blog. Therefore if you really want to avoid such redirection then follow the steps discussed above.  This is a simple java script that forcefully redirects to the .com extension. 

0 comments:

Post a Comment