Website Design and Graphics > HTML Forum

how do i stop to my blog redirect to a country-specific URL?

(1/1)

oliviasrodriguez:
Many friends told me that you should stop your blog redirect to a country-specific url on your blog. What should i do now?

Shikha Singh:
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.

<script type="text/javascript">
 
  // Written by Amit Agarwal
 
  /* Get the full URL of the current blogger page */
  var blog = document.location.href.toLowerCase();
 
  /* Do not redirect if the domain is .com already */
  if (!blog.match(/\.blogspot\.com/)) {
 
    /* Replace the country TLD with .com and ncr switch */
    blog = blog.replace(/\.blogspot\..*?\//, ".blogspot.com/ncr/");
 
    /* Redirect to the new .com URL in the current tab */
    window.location.replace(blog);
  }
 
  // Source: http://labnol.org/?p=21031
 
</script>

kareem:
Stop Blogger from Redirecting to Country-Specific Domains
All you have to do is add an ncr/ to the end of the URL - ncr here stands for No Country Redirect.

saravanan28:
Use Custom Domains: The users who are using custom domain will not be affected, since their url structure will remain the same and it will not be redirected ( Refer this). Adding 'ncr' slug to blog url: Adding a 'ncr' slug to your blog url stops the redirection and it shows the actual domain address.

Lishmalinyjames:
One of the easiest ways to block Blogger's redirects is to manually add “/ncr” on to the end of the URL you are working with, in order to stay locked on to the original domain.

Navigation

[0] Message Index

Go to full version