Jump to content

Recommended Posts

   <!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.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/296533-old-site-does-not-re-direct-to-new-site/
Share on other sites

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.

  • Like 1

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.

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?

 

 

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.

 

 

 

//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

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 by cyberRobot
  • Like 1
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.