Search This Blog

19.4.12

0 PREVENT BLOG REDIRECTION TO COUNTRY-SPECIFIC URL.

I recently came across a tutorial which talks about redirecting blogger blogs back to .com after Google started redirecting blog url to that country's URL.

If you have a blog, e.g yourblog.blogspot.com,the blog might be redirected to yourblog.blogspot.in for some countries.
In other countries,it might be .com.au , .com.uk , .tketc.

As a blog owner,it is necessary to redirect your blog back to .com.
To do this,all you have to do is add some little javascripts into your blogger template.

Go to Design >> Edit HTML.Backup your template in case something goes wrong.

Check the box next to
Expand Widget Template and search for </head> by pressing ctrl+f.

Now,add the following code just ABOVE </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>

Preview your blog,& save the template.
Its as simple as that!!!
«PREVIOUS NEXT» ¤HOME¤

Be the first to reply!

Leave your comments behind!!

If you experienced any difficulty understanding this post,do tell us. But,please do not spam.
Your suggestions are also very valuable to us. Thanks...
The Author.

Leave your comments.

If you need reply to your comments,please do not comment as `Anonymous`
Found a Dead or Unresponsive link?, Kindly inform us using the Comment Box.

 
[GET THIS]