Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Whats a good redirecting code?

    What's the code i can use to redirect to another page?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    <html>
    <head>
    <meta http-equiv="REFRESH" content="0; URL=http://www.myotherpage.com">
    </head>
    </html>

    If you want a delay replace 0 by the number of seconds delay required.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,457
    Thanks
    0
    Thanked 632 Times in 622 Posts
    Better yet if your site is running on Apache add the redirect into the .htaccess file so that the old page doesn't have to exist at all.

    Redirect /olddir/odfile.html http://yoursite.com/newdir/newfile.html
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •