Pages

Stop Blogger from Redirecting to Country URLs

Q: My blogspot.com blog redirects to country-specific domain. When I open my blog example.blogspot.com, it automatically changes to example.blogspot.in. I want to stop my blog from redirecting to country specific domain. How to do it?

Ans: Follow these steps:

Step 1. Login into your Blogger account.

Step 2. On Dashboard, choose your blog. 

Step 3. Click on'Templates and then click on 'Edit HTML' button.

Step 4. Find '</head>' tag by pressing Ctrl+F.

Step 5. Paste following code before '</head>' tag.
<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 6. Click on 'Preview' button and if everything is fine,then Save the template.

From now onwards, blogger will not redirect and will always show blogspot.com.