JERRYONG.com Community Blog

Tech, Web, How to, Gadgets, Business, Reviews, Tips, Downloads, Jobs, Moblog, Make Money Online & Community Social Network – JerryOng.com

Auto website redirecting methods and examples

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 Bookmarks
  • TwitThis
  • StumbleUpon
  • Live
  • Furl
  • NewsVine
  • LinkedIn
  • SphereIt
  • MisterWong
  • email
Categories: blog
How to create Mobile or WAP site for your blog and website!

soup of the day : “Anyone want to join me for Malaysia F1 @ Sepang, i have extra Free tickets”This is a simple 5 minutes tutorial about How you can Create a Mobile friendly site or in technical jargon -…
23 March 08 at 00:27
 
[...] and insert the above generated code between your <head> </head> , alternatively you can create a redirect code & redirecting your subdomain to your newly create iPhoneize RSS [...]
website has been set up for the sole purpose of ranking highly in the . auto redirecting methods and example.
25 May 10 at 18:31
In fact, auto-redirecting is used when a website has been set up for the sole purpose of ranking highly in the.
25 May 10 at 19:30
A number of different auto-redirecting methods with practical examples.
26 May 10 at 17:41
blog comments powered by Disqus