Prevent Blogger URL to Redirect to Regional Blogger URL
By Aashu on Dec 30, 2012 with Comments 0
If you are Using Blogger Blog with Subdomain of Blogspot then you noticed that when you visit you may be redirected to yourblogname.blogspot.in for indians or yourblogname.blogspot.com.br for Brazil and many other different for different location.
If you want to prevent redirection of your blogspot address then there’s simple code which you have to Paste in your Template. To do that just follow the Steps:-
- First Copy the Code Below
| Javascript | | copy code | | ? |
| 01 | |
| 02 | <script type='text/javascript'> |
| 03 | var host = document.location.hostname; |
| 04 | var path = document.location.pathname; |
| 05 | var ctld = host.substr(host.lastIndexOf(".")); |
| 06 | if (ctld != ".com") { |
| 07 | var url = "http://" + host.substr(0, blog.indexOf(".")); |
| 08 | url += ".blogspot.com/url"+ path; |
| 09 | window.location.replace(url); |
| 10 | } |
| 11 | </script> |
| 12 |
- Then Go to Blogger Blog and Select your Blog
- Then Go to Template
- Then Click on Edit HTML under Live on Blog section
- Then Press Ctrl + F it opens browser search here type “” without quotes
- Above “” Paste Above Code
- Then Save Template and you are Done!
- The Above code is to redirect your Regional Address to .com address if you want a regional address instead of .com then in code Sixth and in Eighth row replace .com with regional address like .in for Indian, .com.br for Brazil, .com.au for Australia , co.il for Israel etc you can google it.
Short URL: http://is.gd/fRrLTF
QR Code For This Post:
About the Author: I [Arshpreet Wadehra] am web Developer good in php, html5, css3, css, jquery & also know C++ .
Always try to learn something new about technology and like to share any new tech info & tricks with you!
@Wadehrarshpreet
