auto redirect

Discussion in 'Web Design & Coding' started by Punkychan, Mar 17, 2003.

  1. Punkychan

    Punkychan OSNN Addict

    Messages:
    247
    I'm quite new in html codings but what I wanted to know is how to automatic redirect a website i.e. from my old url to a new one ?Thanks for any help.
     
  2. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Using a meta refresh should work :)...
    Code:
    <html>
     <head>
      <title>Site Moved</title>
      <META HTTP-EQUIV=Refresh CONTENT="5; URL=http://www.NEWSITE.com/">
     <head>
    <body>
    Page Moved!
    <br>
    You will be re-directed to <a href="http://www.NEWSITE.com/">NEWSITE</a> in 5 seconds.
    </body>
    </html>
     
  3. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Or a javascript re-direct ... but the user will need to hava javascript enabled for this to work, most people do, but not everyone ;)
    Code:
    <html>
     <head>
      <title>Site Moved!</title> 
     </head>
    <body>
    <script language="javascript" type="text/javascript">
    setTimeout("window.location.replace('http://www.newsite.com');",5000);
    </script>
    Site Moved
    <br>
    You will be taken to <a href="http://www.newsite.com">newsite.com</a> in 5 seconds.
    </body>
    </html>
     
  4. jonifen

    jonifen pffff...

    Messages:
    705
    or u can use this

    PHP:
    <body onload="parent.location='http://www.wibble.com'">