Saturday 15 September 2012

Preventing Blogger Redirecting to Country Specific URL


Preventing Blogger Redirecting to Country Specific URL



As many would know Google is redirecting its blogger users to country specific domains.For Instance You will be redirected to site.blogspot.in if you are from India.This ensures country specific censorship so that specific blogs can be blocked in that specific country.

There is a workaround for this.

Goto Blogger Dashboard ->Templates Click Edit HTML and Proceed.Now Use the code given Below and Paste ist after <head> tag.<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> Click on Save Template Button. This Java Script Make Uses of the ncr workaround and prevents redirection.

No comments:

Post a Comment