In this post, I will discuss on the topic how to prevent Blogger from Redirecting to Country-Specific Domains or URL's.

This country primarily based URL redirection will mean some negative consequences to your Blogger journal. For example:
  • The social stats – or Facebook Likes, Google +1s and Tweet counts – for your site(Blog or website) stories is also diluted because the URLs for an equivalent story become totally (different|completely different) from different guests.
  • You'll have associate degreealogous (the same)drawback if you're mistreatment an external commenting platform like Discuss or Facebook Comments.




If you're not pleased with the concept of Blogger redirecting your journal to a special URL, you'll be able to add the subsequent piece of code to your Blogger model and it'll continually serve the .com address to your guests regardless of their geographic location.

  1. Go to your  Blogger Dashboard and click Template.
  2. Find and click "HTML".
  3. Now, use Ctrl+f to search and find <head>.
  4. Next, copy and paste the below code after the <head> tag in the template. 
     
     
    <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>
     
      
    
  5. Click "Save Template".
Now, your blog will result with the blogspot.com URL.

This simple script parses the name (document.location.hostname) of your journal page and if it includes a country-specific URL (like blogspot.in), it'll force-redirect the traveler to the blogspot.com address mistreatment the /ncr switch.