Saturday, February 2, 2013

How to Stop your Blogger Blog from Redirecting to Country Domains


How to Stop your Blogger Blog from Redirecting to Country Domains


When you open your blog you will be redirected to the country based domain of your blog.
This will affect your blog badly. For Example:

  1. The social stats – or Facebook Likes, Google +1s and Tweet counts – for your blog stories may be diluted as the URLs for the same story become different from different visitors.
  2. You will have a similar problem if you are using an external commenting platform like Disqus or Facebook Comments.

To prevent this you need to add this code to your Template.
Go to Blogger -> Template -> EDIT HTML

Paste this code below <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>

No comments:

Post a Comment

Leave the comments