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 6 of 6
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to redirect my Index.htm to another server?

    I’m in the process of changing internet providers. I would like to test redirecting my existing index.htm to my new website index.htm. Is this possible, and can someone show me what I need to put in a temp index.htm to make it work?
    Thanks,

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    You could use a meta refresh:

    Code:
    <meta http-equiv="refresh" content="5;url=http://www.mynewsite.com" />
    (Put that in you head, and it will redirect users after 5 seconds)

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Posts
    64
    Thanks
    4
    Thanked 3 Times in 3 Posts
    hi, i've just found this

    Code:
    <META http-equiv="refresh" content="1; URL=http://www.yournewpage.com/index.html">
    or edit the htaccess directly

    hey, i'm a little late!

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you both for quick reply.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Meta refresh is not the proper way to redirect a user as it relies on the browser to support it. Some browsers allow you to disable this feature. I recommend you use a .htaccess file if your host supports it.
    Code:
    Redirect /Index.htm http://www.otherserver.com
    http://www.javascriptkit.com/howto/htaccess7.shtml
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    You could also combine the meta refresh method with a page telling the user you've moved and they will be redirected, but if they aren't, "click here"

    if you don't have .htaccess or don't want to mess with it

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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