Html code to go to another website

Discussion in 'HTML & Website Design' started by shahab6, Feb 14, 2007.

  1. #1
    What is the Html coode to make a website automatically go to another website?

    For example you go here www.example.com but once your there, it will take you to another website.
     
    shahab6, Feb 14, 2007 IP
  2. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    301 redirect - normally done through your server/host...not via a code in your html

    but having said that...it can be done with something like php or asp etc...

    eg. this is a php redirect
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>
     
    unitedrokz, Feb 14, 2007 IP
  3. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes better done via .htaccess and a 301 but in strict html you could do:

    <meta http-equiv="Refresh" content="4;url=http://www.domain.com/link.html">
    Code (markup):
     
    Munk, Feb 14, 2007 IP
  4. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Or you could even use PHP:

    header("Location: http://www.example.com");
    Code (markup):
     
    rgchris, Feb 15, 2007 IP
  5. Munk

    Munk Peon

    Messages:
    56
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes! Just like the post 2 up from you! :D
     
    Munk, Feb 16, 2007 IP