Software Installation Problem/Software Course Want to learn Call 8801005610

Prevent Blogger from Redirecting your Blogspot Blog to Country-Specific URLs

Google now redirects Blogger blogs to country-specific domains. For instance, if you open example.blogspot.com in your web browser, you will be redirected to example.blogspot.in if you are located in India or toexample.blogspot.co.uk if you are accessing the blog from UK.
Google does country-specific redirection for selective censorship – that means they can easily censor or block a blog post, or other entire blog site, in one country but still serve that page in other geographic regions. Blog redirection only occurs if you are on a blogspot domain and not if your Blogger blog is on acustom domain.
blogger countries
My traffic logs suggest that country-specific redirection in Blogger is live in at least 15 countries. They are India [blogspot.in], Australia [blogspot.com.au], UK [blogspot.co.uk], Japan [blogspot.jp], New Zealand [blogspot.co.nz], Canada [blogspot.ca], Germany [blogspot.de], Italy [blogspot.it], France [blogspot.fr], Sweden [blogspot.se], Spain [blogspot.com.es], Portugal [blogspot.pt], Brazil [blogspot.com.br], Argentina [blogspot.com.ar], Mexico [blogspot.mx]

Prevent Blogger from Redirecting to Country-Specific Domains

This country based URL redirection is likely to impact your Blogger blogs in a not so positive manner. For example:
  1. The social stats – like your Facebook Likes, Google +1s and Tweet counts – for your blog posts may be reduced as the URLs for the same blog post will be different for different visitors.
  2. You will have a similar problem if you are using an external commenting platform like Disqus or Facebook Comments because the blog URLs will be different even when the underlying page is the same.
  3. Also, if canonicalization isn’t implemented properly, it may cost you some Google juice as external websites may link to your country-specific pages.
  4. Some users have reported a dip in Google AdSense earnings when pages are served through country-specific domains.
If you are not happy with the idea of Blogger redirecting your blog to a different URL, you can add the following piece of code to your Blogger template and it will always serve the .com address to your visitors irrespective of their geographic location.
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.
  1. <script type="text/javascript">
  2.  
  3. // Written by Amit Agarwal
  4. /* Get the full URL of the current blogger page */
  5. var blog = document.location.href.toLowerCase();
  6.  
  7. /* Do not redirect if the domain is .com already */
  8. if (!blog.match(/\.blogspot\.com/)) {
  9.  
  10. /* Replace the country TLD with .com and ncr switch */
  11. blog = blog.replace(/\.blogspot\..*?\//, ".blogspot.com/ncr/");
  12.  
  13. /* Redirect to the new .com URL in the current tab */
  14. window.location.replace(blog);
  15. }
  16.  
  17. // Source: http://labnol.org/?p=21031
  18. </script>
Click the Save Template button and now your Blogger Blog will always serve with the blogspot.com URL.
The JavaScript snippet gets the URL of the current Blogger page and if it isn’t served from the .com domain, the code replaces the country specific TLD (like blogspot.co.au or blogspot.pk) with the blogspot.com URL. It also adds the /ncr switch to force-redirect the visitor to the blogspot.com address.
[5/4/2015] – The snippet is now more efficient and can handle both www and non-www blogspot URLs including those served from secure HTTP (https).
[11/9/2015] – Code fixes
SHARE

Manohar Mohanta

Hi, I am Designer of computer solutions. I am CEO/Founder of computer hardware and software solutions. I am Creative Art Director, Web Designer, VHDL Programer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. Useful information like this one must be kept and maintained so I will put this one on my bookmark list! Thanks for this wonderful post and hoping to post more of this!

    LG Laptop repairs, Lenovo Laptop repairs & Hp Notebook repairs

    ReplyDelete