Saturday, 4 April 2015

// // Leave a Comment

How To Avoid URL Redirecting To Country Specific URL In Blogger

You may have noticed many times that when you open a blogspot blog, the URL of that page redirects to the extension based on your location. For example, when you open a blog with name example.blogspot.com from India, then it will automatically redirects to example.blogspot.in. This happens with every blogspot blog and every time depending on the users location. Generally, most of the bloggers don't care about this and they simply ignore it. But you may be surprised to know that it has some negative effects.

Avoid URL Redirecting To Country Specific URL In Blogger

Following are some negative effects of URL redirecting to country specific URL -

  • Social media stats like Google+1s, Facebook likes and tweet counts for your blog posts may be diluted because the URL of the same post will become different for different users.
  • If you are using an external commenting system then it may cause problem in time of comments.
  • It will affect your Alexa rank because the number visits is divided between different countries.
You can avoid this URL redirection by following these simple steps given below.

Avoid URL Redirection To Country Specific URL

Step 1 : Open your blogger's dashboard. Go to 'Template' and click on 'Edit HTML'.

Avoid URL Redirecting To Country Specific URL In Blogger


Step 2 : Click anywhere inside the code and then using the keys Control+F, open search box.
Avoid URL Redirecting To Country Specific URL In Blogger


Step 3 : Search for </head>

Step 4 : Now copy and paste the following code just above it.
              <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>


Step 5  : Save the template and that's it. You are done with it. Now your blog is permanently set to example.blogspot.com.

I hope this tutorial helped you. Please comment here if you have any queries.