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.
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):
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?
Ok. Got it now. No need to reply. All is working perfectly so thanks for updating me on the code. Job well done.
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.
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.
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.
check this link for solution http://amitdesigner87.blogspot.com/2011/06/how-to-redirect-your-website-after-5.html