html page that directs you to a different page?

Discussion in 'Web Design and Development' started by howard, Jan 15, 2008.

  1. macrumors 68020

    howard

    Joined:
    Nov 18, 2002
    #1
    Say you have sent out a link to a certain webpage on your site, but you changed the site and now the old link is dead. is it possible to set up an html file at the old link that automatically directs the browser to the new page?

    i feel like this should be an easy answer... i just don't know it!
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Two ways to accomplish:

    1. HTML: <meta http-equiv="refresh"
      content="0;url=http://new.url" />
      -- You can change the "0" to a different wait time till redirect. That's helpful if you put in a dummy page saying why they're being redirected.
    2. Apache web server: Redirect 301 /oldpage http://new.com/file.html -- The 301 means it's a permanent redirect. The destination URL must be the full thing, http and all. For further reading, http://httpd.apache.org/docs/1.3/mod/mod_alias.html
    3. Additional reading for your pleasure, http://www.yolinux.com/TUTORIALS/ApacheRedirect.html
     
  3. macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #3
    How's about this for a complete page?

    Can't for the life of me remember where I got it, so comments welcome. Anyway, I've used it.

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><meta http-equiv="refresh" content="0;url= welcome.html" /></head><body></body></html>
     
  4. thread starter macrumors 68020

    howard

    Joined:
    Nov 18, 2002

Share This Page