Blogroll

Powered by Blogger.

Monday, 16 June 2014

How to Redirect blogspot Address (Eg : blogspot.in) to blogspot.com?

by realfinetime  |  in blogger at  11:47

                When I created my blog http://myfunnyelectronics.blogspot.com/, I found that, my site is automatically redirecting to http://myfunnyelectronics.blogspot.in/, since I had created my blog from India. When I searched for a solution to redirect my blog to http://myfunnyelectronics.blogspot.com/, I found that a simple JavaScript code is enough to redirect my site from http://myfunnyelectronics.blogspot.in/ to http://myfunnyelectronics.blogspot.com/. Following method illustrates the same solution.

Go to Blogger Dashboard. Click on Template.



Now click on Edit HTML button.

Search for </head> tag ( CTRL + F ). Now paste the following JavaScript code just above the </head> tag as shown in the following image.

<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>


Save your template. Now your blogspot web address will be redirected to blogspot.com.

1 comment:

IMPORTANT NOTICE

All the circuits, published in this blog is only after testing and getting proper results in my private lab. When you try these circuits, you should check the supply voltage, polarity of components, presence of childrens nearby and shorts in the circuits. This website will not be responsible for any harm happened to you or your components caused by your carelessness.

For More Electronic Tips

Proudly Powered by Blogger.