New Blogger Redirection Code to redirect your site to .com domain

Redirect blogger code

After my review i found the blogger redirect code where you can redirect your local site to international .com domain for example example.blogspot.com will redirect to .in in india and .com.au in australia and so on , this is the big problem for sites with good page rank and alexa  rank. Now here is the best code for the blogger

  1. Argentina [blogspot.com.ar] 
  2. Australia [blogspot.com.au] 
  3. Brazil [blogspot.com.br] 
  4. Canada [blogspot.ca] 
  5. Czech Republic [blogspot.cz]
  6. France [blogspot.fr] 
  7. Germany [blogspot.de] 
  8. Hong Kong [blogspot.hk]
  9. India [blogspot.in] 
  10. Italy [blogspot.it] 
  11. Japan [blogspot.jp] 
  12. Mexico [blogspot.mx] 
  13. New Zealand [blogspot.co.nz] 
  14. Portugal [blogspot.pt] 
  15. Romania [blogspot.ro]
  16. Spain [blogspot.com.es] 
  17. Sweden [blogspot.se] 
  18. UK [blogspot.co.uk]
you already know the code below

<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 += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}
</script>

this code sometime redirect to not found page...

below is the best code to redirect your site to perfect .com domain

<script type='text/javascript'> var str= window.location.href.toString(); if ((str.indexOf('.com/'))=='-1') { var str1=str.substring(str.lastIndexOf(".blogspot.")); if (str1.indexOf('/')=='-1') { var str2=str1; } else { var str2=str1.substring(0,str1.indexOf('/')+1); } window.location.href =window.location.href.toString().replace(str2,'.blogspot.com/ncr/'); } </script>



No comments:

Post a Comment

About

authorHello, my name is Ravi R Naik. I'm a 20 year old self-learned blogger and writer.
Learn More →