Redirect versus refresh
Oct. 17th, 2006 08:45 amI spent the weekend cleaning up my vanity site, CSSizing it and such. Since I moved a few documents around, I wanted to make sure that they were still findable. Most of the site wasn't PHP before (it is now for common navigation / footer includes, etc.) so I had the challenge of how to send people to the new pages.
It's most common to find "refresh" pages, ones that you go and they redirect you to another location with a 0 timeout (and often a cute little notice that says if your browser doesn't DTRT, you should click the link). There doesn't seem to be another meta tag that could do the redirect trivially.
This is another case where PHP wound up being useful. Since I moved my weblog from my homesite to LiveJournal a while ago to let comment spam be Someone Else's Problem, I had that and a whole directory of stuff underneath it that was no longer there.
Now works for http://www.raspberryginger.com/jbailey/weblog and any of the directories underneath it. Another side trick to this is that if I had a file foo.html, I can create a foo.html.php file with the same sort of thing in it. Apache's automatic extension tracking will find the .php file and sort it out automatically.
One thing I did discover is that if I have "weblog.tar.gz" and "weblog.php" sitting side by side, apache will prefer the .tar.gz file. *sigh*
It's most common to find "refresh" pages, ones that you go and they redirect you to another location with a 0 timeout (and often a cute little notice that says if your browser doesn't DTRT, you should click the link). There doesn't seem to be another meta tag that could do the redirect trivially.
This is another case where PHP wound up being useful. Since I moved my weblog from my homesite to LiveJournal a while ago to let comment spam be Someone Else's Problem, I had that and a whole directory of stuff underneath it that was no longer there.
jbailey@titanium:~/web$ cat weblog.php
<?php
header("HTTP/1.0 301 Document Moved");
header("Location: http://jbailey.livejournal.com/");
exit();
?>Now works for http://www.raspberryginger.com/jbailey/weblog and any of the directories underneath it. Another side trick to this is that if I had a file foo.html, I can create a foo.html.php file with the same sort of thing in it. Apache's automatic extension tracking will find the .php file and sort it out automatically.
One thing I did discover is that if I have "weblog.tar.gz" and "weblog.php" sitting side by side, apache will prefer the .tar.gz file. *sigh*
content negotiation
Date: 2006-10-17 02:03 pm (UTC)That's configurable (http://www.grep.be/blog/en/computer/play/apache_content_neg)
Re: content negotiation
Date: 2006-10-17 06:43 pm (UTC)Re: content negotiation
Date: 2006-10-21 09:02 pm (UTC)I'm not sure where I am on the "old files lying around" versus just having them in an htaccess file. I tend to like seeing them on a directory.
Re: content negotiation
Date: 2006-10-21 09:03 pm (UTC)