Automatically redirect your blog or website to a new / different location in 5 minutes Tongue out

I had to move my entire old blog - Trio Concept to a new location @ blog.jerryong.com (ie. move it to a different location). So how do I redirect people from my old site automatically to my new website ?

(Note: if your server supports either Frontpage-extensions or a .htaccess file, then consider using these options, most webserver blogserver supported)

see example @ http://trioconcept.blogspot.com , it auto redirect back here in 8 seconds.


 

Copy and Paste the following JavaScript to you blog template or html:

<script>
<!–
function autoChange()
{
var timeID = setTimeout("location.href= ‘http://www.newlocation.com‘", 1)
}
//–>
</script>

  1. Replace new location address that you wish to redirect @ http://www.newlocation.com
  2. If set the value @ 1, this little script will wait 1 millisecond and then jumps to http://www.newlocation.com.

The delay time (indicated in bold) can be altered to for example 1000 milliseconds (1 second).

Important : Just copying this code will not do the job ! We need to trigger this procedure. This is done by adding "autochange()" to the OnLoad-event of your HTML file.

Add this event to the <BODY> tag as shown below:

<body onLoad="autoChange()">

In this example I set the OnLoad-event to execute the script we just have seen.
A full page HTML file would be similar to this one:

<HTML>
<script>
<!–
function autoChange()
{
var timeID = setTimeout("location.href= ‘http://www.newlocation.com’", 1000)
}
//–>
</script>
<BODY onLoad="autoChange()">
Welcome to my website,… unfortunally we moved it to WWW.NEWLOCATION.COM.<BR>
Your will be auto redirecting in 1 second.<BR>
If it doesn’t then please click <A HREF="http://www.newlocation.com">here</A> to visit my new blog.
</BODY>
</HTML>

This page will display a warning that the website moved and that the browser will redirecting automatically in 1 second.

Just for those browsers that do not support JavaScript (most browser support), we add an additional link including the link to the new site so they can click there.

Note: naturally, this HTML file should be placed on the OLD blog or website template

Share and Enjoy:
  • Digg
  • Technorati
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • StumbleUpon
  • Live
  • Furl
  • NewsVine
  • LinkedIn
  • SphereIt
  • MisterWong
  • E-mail this story to a friend!

Related posts:

  1. HOW TO: iPhone-ize Your Website / Make Your Website iPhone Friendly
  2. Let Google Translate Your Blog / Website Automatically
  3. How to create Mobile or WAP site for your blog and website!
  4. Christmas Snow Effect For Your Blog / Website
  5. How to Converting / Export blog post from Blogger to Movable Type
  6. Make money from your Website or Blog - get paid for every click!
  7. How to Backup / Export Blogger
  8. Video of Nissan Fairlady 350z (Auto) Drift @ GoKart Day

« « How to Converting / Export blog post from Blogger to Movable Type

Poshy Bird Nest Moon Cake » »