Media Magazine

How to Prevent Blog to Redirect Other Country URL

Posted on the 13 August 2015 by Jani18

stop blogger blog to redirect to other country url

In blogger your blog is redirect specificcountry domain if you visitor comes fromother country like if it come from india it may show blogspot.in instead of blogspot.comand same wise it works with other countrylike for uk visitors ,the blog url appearsblogspot.uk so it differs with country.Itis good idea for blogger to stop blogto redirect other country domain url so that use remind your blog url easily stop blog to redirect to other country domain


step1: first login to blogger blog accountand then go to templatestep2:paste the given code before <head>

<script type="text/javascript"> /* 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/"); /* Open the new URL in the current tab */ windows.location.replace(blog); } </script>
save your template and you had done
Enjoy............!

Back to Featured Articles on Logo Paperblog