Tag Archives: blogger

How to Keep Stay with your .com Domain for Blogger


Whenever you have created a blog using blogger, while publishing it will redirect you to your country specific domain instead of .com. To avoid this country specific domain extension redirect, follow the below steps.

  • Go to your Blogger Dashboard
  • Select Template section
  • Now, Click the “Edit HTML”
  • Then, copy-paste the following code after the tag into the HTML template.

<script type=”text/javascript”>
var blog = document.location.hostname.split(“.”);
if (blog[blog.length – 1] != “com”) {
var ncr = “http://”+ blog[0] + “.blogspot.com/ncr”;
window.location.replace(ncr + document.location.pathname);
}
</script>

 

Note: In the above code, put a space before + blog[0], if it is not working properly.

Advertisements
%d bloggers like this: