Sunday 12 January 2014

How to Redirect blogspot URL to your custom country URL?


  1. Make sure you're signed in to your blogger's control panel I mean design or dashboard.
  2. Now go to the template option. (Backup your template if necessary)
  3. Click on Edit HTML. Now you can see the code of your template. 
  4. Hit on the template box and Press Ctrl+F to enable search within the code box.
  5. find the <head> of your template and then copy the code below and place it just below the head tag. (Look at the image below)
  6. Save the template. Done! 

<script type='text/javascript'>
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf(&quot;.&quot;));
if (ctld != &quot;.com&quot;) {
var ncr = &quot;http://&quot; + blog.substr(0, blog.indexOf(&quot;.&quot;));
ncr += &quot;.blogspot.com/ncr&quot; + slug;
window.location.replace(ncr);
}
</script>

No comments:

Post a Comment