redirect after 5 seconds page

Discussion in 'HTML & Website Design' started by silvastar, Jun 13, 2011.

  1. #1
    Just wanted to ask 2 questions.

    1. I want to redirect a .com website to a .com.au (which is the main page). Do you think it would be best SEO practice to just set up a auto redirect or do you think I should set up a landing page that opens up the site and a message appears saying 'you will be redirected after 5 seconds, click here if you are not redirected'?

    2. What is the code needed to have a page that auto redirects after 5 seconds? Is it a cpanel thing or do I need to paste code on my site?

    Thanks.
     
    silvastar, Jun 13, 2011 IP
  2. Guru_101

    Guru_101 Member

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    You can do it in many ways, such as cpanel redirect which does a 303 redirect which changes everything on that domain to the other .com.au domain.

    However, in a php or a html standard where if someone types in "http://whatever.com" it will load the index.html or index.php and it will redirect to "http://whatever.com.au".

    Html Way: index.html
    
    <html>
      <head>
          <meta http-equiv="refresh" content="5; URL=thankyou.htm">
      </head>
    
           <body>
              <p>Write anything you would like to display</p>
           </body>
    </html>
    
    Code (markup):
    Or the php way: index.php (i think i like this way the best, its faster!)
    
    <?php
    
    //  refresh / redirect to an internal web page
    //  ------------------------------------------
    header( 'refresh: 5; url=/webdsn/' );
    echo '<h1>You will be re-directed in 5 seconds...</h1>';
    
    
    //  refresh / redirect to an internal web page
    //  ------------------------------------------
    header( 'refresh: 3; url=/' ); # redirects to our homepage
    echo '<h1>You will be re-directed in 3 seconds...</h1>';
    
    
    //  refresh / redirect to an external web page
    //  ------------------------------------------
    header( 'refresh: 0; url=http://www.example.net' );
    echo '<h1>You won\'t know what hit you!</h1>';
    ?>
    
    
    Code (markup):
     
    Guru_101, Jun 13, 2011 IP
  3. silvastar

    silvastar Active Member

    Messages:
    449
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I really like this version:
    // refresh / redirect to an external web page
    // ------------------------------------------
    header( 'refresh: 0; url=http://www.example.net' );
    echo '<h1>You won\'t know what hit you!</h1>';
    ?>

    Where would I put that code on my site?

    In the Head section or just on the normal code?
     
    silvastar, Jun 13, 2011 IP
  4. silvastar

    silvastar Active Member

    Messages:
    449
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Ok. Got it now. No need to reply. All is working perfectly so thanks for updating me on the code.
    Job well done.
     
    silvastar, Jun 13, 2011 IP
  5. IonVM

    IonVM Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I know you got it working, but thought I'd mention that this can also be done with the .htaccess file (if you have access to it). It's a slightly 'cleaner' method.
     
    IonVM, Jun 13, 2011 IP
  6. silvastar

    silvastar Active Member

    Messages:
    449
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #6
    oh ok. That sounds interesting. I do use the htaccess file to do 301 redirect and non www to the www but don't know what the code is to do what you are talking about. Feel free to post it here if you like.
    Thanks.
     
    silvastar, Jun 13, 2011 IP
  7. prclicks

    prclicks Peon

    Messages:
    353
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you can use .htaccess file for redirect purpose. Even you can set your timing after that you want redirect that page after particular time. Thanks for sharing this query & answers.
     
    prclicks, Jun 13, 2011 IP
  8. allwebactivities

    allwebactivities Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  9. jacksamwhite

    jacksamwhite Member

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #9
    Its better if you redirect your website directly. Always use 301 redirect which is SEO friendly too.
     
    jacksamwhite, Jun 18, 2011 IP
  10. br3adman

    br3adman Active Member

    Messages:
    1,844
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    80
    #10
    Don't use 5 seconds use 0 and delete everything so the site loads fast enough
     
    br3adman, Jun 18, 2011 IP