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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: