Blogger Post and Country-Specific Domains

How to Prevent your Blogger blog from redirecting the country-specific URL.

Google, as most would know, redirects Blogger blogs to country-specific domains. For instance, if you open in your browser, you might be redirected to if you are located in India or to if you access the same blog from Australia.

Prevent Blogger from Redirecting to Country-Specific Domains

Go to your blog inside the Blogger Dashboard and choose Template. Then click the “Edit HTML” button followed by “Proceed.” Next, copy-paste the following code into the template after the <head> tag. thanks to labnol for this code

<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 += "" + slug;

Click the Save Template button and now your Blogger Blog will always serve with the URL.

This simple script parses the domain name (document.location.hostname) of your blog page and if it includes a country-specific URL (like, it will force-redirect the visitor to the address using the /ncr switch.

Got Something to Add?
0 comments: Post a Comment

Older Post