Sponsored Link


Sponsored Links

Friday, December 13, 2013

How to Stop Blogger Redirecting to a Country Specific URL

Google has implemented ccTLD to improve content managing locally. The address will correspond to the country specific url extension depending on writers country of Origin i.e. where the blog writers are located and willing to highlight their regions need base. The main motive of this redirect is to remove the censored content of your Blog in your local region.

country-specific redirection in Blogger is now live for many countries. Here’s a list of few countries we came across:

Argentina [blogspot.com.ar], Australia [blogspot.com.au], Brazil [blogspot.com.br], Canada [blogspot.ca], France [blogspot.fr], Finland [blogspot.fi], Germany [blogspot.de], Greece [blogspot.gr], Hong Kong [blogspot.hk], India [blogspot.in], Italy [blogspot.it], Japan [blogspot.jp], Mexico [blogspot.mx], Netherlands [blogspot.nl], New Zealand [blogspot.co.nz], Portugal [blogspot.pt], Russia [blogspot.ru], Singapore [blogspot.sg], Spain [blogspot.com.es], Sweden [blogspot.se], UK [blogspot.co.uk], etc

But there is an issue, if you write an article on a issue which is honest view but it is something against local authority and there is a chance of getting your blog blocked by them or it may get removed by Google without intimating you or you may get a notification from them showing the reason. There is lower possibilities if you use a blogspot.com extension for your blog. You can control the redirection. This can be done with the help of JavaScript.

Here is how to prevent your blog from redirecting to a Country-Specific Domain (ccTLD).

Step 1: Make sure you are signed in to your blogger's dashboard.

Step 2: Now go to the template option. (Backup your template if necessary)

Step 3: Click on "Edit HTML" to customize the code of your blogs template.

Step 4: Hit on the template box and Press Ctrl+F to enable search.

Step 5: search for the <head> of your template and



Step 6: then copy the code below and place it just below the head tag.
<script type='text/javascript'>
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf(&quot;.&quot;));
if (ctld != &quot;.com&quot;) {
var ncr = &quot;http://&quot; + blog.substr(0, blog.indexOf(&quot;.&quot;));
ncr += &quot;.blogspot.com/ncr&quot; + slug;
How to Stop Blogger Redirect to a Country-Specific Domains (ccTLD)

Step 7: preview the template to make sure its running perfectly

Step 8:
Save the template.

Voila! Now your Blogger Blog is ready to serve with the blogspot.com URL always.

This simple script parses the domain name (document.location.hostname) of your blog page and if it includes a country-specific URL (like blogspot.uk), it will force-redirect the visitor to the blogspot.com address using the /ncr switch. The “no country redirect” (ncr) will prevent Blogger from redirecting its readers to the local version of the blog.

Note: If you blogger blog site is hosted with a custom registered domain like www.example.com or www.example.net or www.example.org, then no need to implement this code as the redirection is not applicable for a site with the custom domain.

Tip: You can also use /ncr/ just after the country-specific domain to set the redirection for your individual post. You casn use the customr paramlink option to set this for your single page. For example, [yourblog].blogspot.com/2013/12/examplepage.html should be entered as [yourblog].blogspot.com/ncr/2013/12/examplepage.html.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Sponsored Link Best Web Hosting Service Provider | SusantaOnline