Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

howard

macrumors 68020
Original poster
Nov 18, 2002
2,017
4
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!
 
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
 
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>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.