How to Remove Country Specific URL from Blogspot / Blogger Site | Remove .in .fr .ca

Sometime Country Specific URL becomes a problem for web developers. For Example my blog bestrix.blogspot.com use to open as bestrix.blogspot.in while it is being accessed from India. But it cause some apps to not work on that country specific URL as they are meant to run on .com domain name. So i did a little R&D to get a solution to this problem. And now here is the solution.

How to Remove Country Specific URL from Blogspot / Blogger
Follow the following steps and remove the .in / .fr / .ca / .au / .pk from your blogger site and get .com domain name from all over the world:

  • Login to you blogger Account
  • Go to Template and Edit HTML
  • Try to find the <head> in the HTML code. Most probably it will on the top of the code.
  • Paste the following code just below the <head>
<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>

  • Save Template and enjoy the .com domain name.

I hope that using this trick you will be able to get a .com domain name instead of country specific URL. You are most welcome to comment on this post if you find it helpful and interesting.
Share this Article :
Email

13 comments:

  1. Worked perfectly for me. Thank you very much...

    ReplyDelete
  2. thank you so much for this. :D

    ReplyDelete
  3. Thank you so much.. works perfectly for me.. :)

    ReplyDelete
  4. Thank you, this worked perfectly. I tried before another code by some Indian guy called Amit (I think) and it wouldn't work so I search for another code and this is great. Perfect.

    ReplyDelete
    Replies
    1. Welcome ! Sorry for replying so late. Just read your comment again and a thought came into my mind that I AM AN INDIAN TOO :-) with a different Pen Name. I hope that your website is working perfectly.

      Delete
  5. Thanks very much. Worked perfectly. You are a guru

    ReplyDelete