otuatail Posted May 29, 2015 Share Posted May 29, 2015 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <META HTTP-EQUIV="imagetoolbar" CONTENT="no"> <meta http-equiv="refresh" content="10 ,URL=http://www.desmond-otoole.co.uk/"> <TITLE>Home</TITLE> </HEAD> <BODY> <h1> Unfortunatly this site is closed. You will be shortly re-directed to the new site (www.des-otoole.co.uk) shortly. </h1> </BODY> </HTML> Hi I thought this was correct and online examples agree also. I want to redirect after 10 seconds to a new site. Claims the site can not be found. Any help on this simple one. TIA Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/ Share on other sites More sharing options...
QuickOldCar Posted May 29, 2015 Share Posted May 29, 2015 Might depend a specific browser handling meta redirect. Instead use header() Not sure why would even want to show a message, could just send them new site, will show both ways though. Direct redirect <?php header("Location: http://www.desmond-otoole.co.uk/",TRUE,301); ?> Delayed redirect with message <?php header( "Refresh:10; url=http://www.desmond-otoole.co.uk/",TRUE,301); echo "Unfortunatly this site is closed. You will be shortly re-directed to the new site (www.des-otoole.co.uk) shortly."; ?> Could also do htaccess redirect rules to make old links lead to new links a different domain. 1 Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512796 Share on other sites More sharing options...
cyberRobot Posted May 29, 2015 Share Posted May 29, 2015 Not sure why would even want to show a message, could just send them new site, will show both ways though. Showing a message can be useful for those that link to / bookmarked the old address. Hopefully they will see the message and correct their link(s) / bookmark(s). It's easier to miss the address change if you instantly direct them to the new location. Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512806 Share on other sites More sharing options...
cyberRobot Posted May 29, 2015 Share Posted May 29, 2015 Hi I thought this was correct and online examples agree also. I want to redirect after 10 seconds to a new site. Claims the site can not be found. The following <meta> tag works for me: <meta http-equiv="refresh" content="10 ,URL=http://www.google.com/"> One thing that I noticed is your <meta> tag uses "http://www.desmond-otoole.co.uk/". But the text in your <h1> tag says the address is "www.des-otoole.co.uk". Which address is correct? Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512807 Share on other sites More sharing options...
otuatail Posted May 29, 2015 Author Share Posted May 29, 2015 The reason I wanted to display a message is that anyone who came to the old site could see that it had changed. If it is automatically changed unless you read the url you are none the wiser and when the old one goes you wont find the new one. Lots of websites do this. The reason I wanted to use the meta tag was that if I make up a html and css I can make it a nicer looking page than just a blank page with text. I have tried your suggestion [sorry not allowed to copy and past here] <meta http-equiv="refresh" content="10, URL=http://www.google.com/" This DOES not work for me. Have a look at www.des-otoole.co.uk and see what happens to the address bar. Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512814 Share on other sites More sharing options...
otuatail Posted May 29, 2015 Author Share Posted May 29, 2015 Ok this is silly it works in firefox, opera, safari and chrome but not in in IE11 Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512815 Share on other sites More sharing options...
CroNiX Posted May 29, 2015 Share Posted May 29, 2015 //display html message here You're being redirected to ...blah blah <?php sleep(10); //wait 10 seconds before redirecting header('Location: http://www.desmond-otoole.co.uk/', 301); ?> Using php with a delay would be more browser foolproof Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512818 Share on other sites More sharing options...
CroNiX Posted May 29, 2015 Share Posted May 29, 2015 Using 301 redirect will also help inform search engines that your content has moved 2 Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512819 Share on other sites More sharing options...
cyberRobot Posted May 29, 2015 Share Posted May 29, 2015 (edited) Ahh...it looks like IE11 doesn't like the comma. Try adding a semi-colon between the "10" and your website address...like the following: <meta http-equiv="refresh" content="10; URL=http://www.google.com/"> More information about the meta refresh tag and its syntax can be found here: http://www.w3.org/TR/WCAG20-TECHS/H76.html Edited May 29, 2015 by cyberRobot 1 Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512823 Share on other sites More sharing options...
otuatail Posted June 1, 2015 Author Share Posted June 1, 2015 Thanks cyberRobot that works Seems like in any html problems it is always IE that fails. maybe bill gates (sorry for the kicking) thinks IE is right and everybody else is wrong. Typical Microsoft attitude. Quote Link to comment https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/#findComment-1512958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.