redirect html code

Discussion in 'Programming' started by ehostingcomplete, Mar 13, 2005.

to remove all ads.
  1. ehostingcomplete

    ehostingcomplete New Member

    Messages:
    42
    I am having trouble with redirecting a user to another page.
    My code is as follows:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Redirecting</title>
    <meta http-equiv="REFRESH" content="0;url=http://www.o-dating.co.uk"></HEAD>
    <BODY>
    Redirecting to <a href="http://www.o-dating.co.uk">www.o-dating.co.uk</a>
    </BODY>
    </HTML>
    
    What am i doing wrong?
    thanks
     
  2. zkiller

    zkiller Super Moderator Staff Member

    Messages:
    1,639
    try changing the 0 to a 1. no clue why it's not working, the code looks fine. just thought that maybe a it's having problems with refreshing in less than 1 second. i doubt that is the problem though.
     
  3. Chroder

    Chroder New Member

    Messages:
    194
    I tried it and it works fine for me.

    Could be some sort of browser issue (they exist), so best to use Javascript as a backup.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
        <title>Redirecting</title>
        <meta http-equiv="refresh" content="0;url=http://www.o-dating.co.uk">
        <script language="javascript">
            window.location = 'http://www.o-dating.co.uk';
        </script>
    </head>
    <body>
    Redirecting to <a href="http://www.o-dating.co.uk">www.o-dating.co.uk</a>
    </body>
    </html>
     
  4. rimian

    rimian New Member

    Messages:
    6
    Could be a server setting. Maybe a security thing.

    If it's still not working for you then try this:

    <script type="text/javascript">
    top.document.location.href = "http://something.com/page.htm";
    </script>

    that should do it.
     
  5. Dmexio

    Dmexio New Member

    Messages:
    17
    Try this...im sure it will work, you can change the delay from the "content" value i have it set to redirect after 5 seconds.

    <html> <head>
    <title></title>
    <meta http-equiv="REFRESH" content="5; url=http://www.google.com">
    </head>
    <body> </body>
    </html>


    All the best
    ________
    Volcano Digital
     
    Last edited: Aug 14, 2011

Share This Page