Anúncios

If you are using , you might have noticed that redirects Blogger Blogspot sites to country specific URLs.

For example, if you open a blog whose URL is http://saibatudomt.blogspot.com, it gets redirected to http://saibatudomt.blogspot.com.br, since I am from . Similarly, a visitor from UK would see http://saibatudomt.blogspot.co.uk and so on.

In a nutshell, Google implemented country specific domains so that is a site need to be blocked in a certain country but made available on others.

But for bloggers, it creates issues especially with social stats like Likes, Tweet counts, Google+ and even Facebook comments.

Therefore, many users prefer to disable the domain redirection. In this post we will see how to implement Blogger from redirecting to country specific domains. Please note that the country domain redirection only applies if you are using Blogger without custom domain.

How to disable country specific redirection of Blogger Blogspot sites?

To disable Blogger from redirecting to country specific URLs, the following code is applied to the Blogger HTML template in the <head> section. You can place it right after the opening head tag <head>.

  1. Go to Blogger dashboard
  2. Theme> Edit HTML
  3. Find <head>
  4. Copy the following JavaScript code and paste it right after <head>
<script type="text/javascript">
//<![CDATA[
!function(){var o,t=document.location.href.toLowerCase();t.split("/").length<5&&((o=(o=(o=t.indexOf("://")>-1?t.split("/")[2]:t.split("/")[0]).split(":")[0]).split("?")[0]).match(/\.blogspot\.com$/)||(o=t.replace(/\.blogspot\..*?\//,".blogspot.com/ncr/"),window.location.replace(o)))}();
//]]>
</script>

You’ll need to enable blogger https redirection:

 

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.