Top Ad unit 728 × 90

How to Prevent Redirection Code in Blogger Template?

Prevent Redirection Code in Blogger Template

What is redirection?

If you create a blog in blogger.com then you can see that out site visitors see your website not in .com but it redirected .in, .it like that. Suppose an Indian visitor looks as example.blogspot.in and from ltali is example.blogspot.it. Because google redirect your web site into local domain.
For example:
Original site: www.3drainbow.blogspot.com
Redirected site: www.3drainbow.blogspot.in

You can prevent with the help of a small code. But note that your website loading time increases slightly like 1-2 second more. In our site of your country website redirect to .com, it will take time little bit [where is local domain]

Why you prevent redirection in blogger template?

* Google takes some facilities from the local domain, but you don’t have nothing.
* Your ranking will be falling down if you use local domain. Like Alexa ranking. Because Alexa could not count separately. And it will hamper your Facebook like or twitter like may be.

 How to solve Redirection?

Log in your blogger site
Go to Template => Edit HTML
Now click on HTML code once and press Ctrl+F
You can find a search box, type <head>
Now paste the below code after <head>

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

You can take the help of below image

Prevent Redirection Code in Blogger Template



Your task is finished. Save your template and go to the browser. Type your blog site url with .in, .it instead of .com. It will redirect you into .com
How to Prevent Redirection Code in Blogger Template? Reviewed by Totana on 01:20 Rating: 5

No comments:

All Rights Reserved by Off Page SEO Tutorial © 2014 - 2015
Designed by JOJOThemes

Contact Form

Name

Email *

Message *

Powered by Blogger.