Redirect Your old Domain extension To the New Domain through Redirection script


#1

Hello Friends. i hope you are fine. Today I am introducing you with a great script which is originally created by me. This script this extremely useful for blogs which have recently changed their domain name from .com to .in, .in to com or anything else. Previously, I have posted a script that is also useful and redirect the domain and its all url to a particular domain’s homepage. But today, I am posting a advanced version of that script can do:

Redirect:

http://www.example.co.vu/

To:

http://www.example.com

You may be thinking that this is what previous script do. But Now, See:

This Script Redirect:

http://www.blablabla.co.vu/anythinghere

To:

http://www.blablabla.com/anythinghere

The Extension (.co.vu) automatically get changed to .com and you will redirect to right domain and to right post.

Here, The benefit of using this script is that, If your visitors is trying to visit a specific post of your blog, they will get redirect to new domain + will redirected to that post. Simply, In simple words, I have created a script that redirect and change .co.vu to .com. So Its normally, If visitors are going to open a post page using old domain, Only domain extension will replaced with .com and they will gets redirected to right post and to right blog. but if we talk about previous script, when a visitor try to visit a specific post page of your blog using your old domain extension, he/she will redirected to new domain’s homepage.

Here’s the script:

So friends, now I am revealing the script that is able to do all the magic for you and your visitor.

  1. Paste this Script Under <head></head>

<script type='text/javascript'> if ((window.location.href.toString().indexOf(&#39;.com/&#39;))==&#39;-1&#39;) { window.location.href = window.location.href.toString().replace(&#39;.co.vu/&#39;,&#39;.com/&#39;); } </script>

  1. Now, Customization, .co.vu is the extension of the url, you are having now and want to changed while redirection. the two .com is the extension in which you want to redirect.

I am Tagging some bloggers here: @Mohammad, @Rohan, @Templatezy, @Mad, @NamanKumar to review If I made some mistake or some mistake in script. :blush:

Enjoy!


#7

This topic is now listed. It will be displayed in topic lists.


What should i do after change domain?