[NCLUG] is mod_rewrite what i want

mbutcher mbutcher at aleph-null.tv
Mon Feb 25 11:03:02 MST 2002


On Monday 25 February 2002 09:59 am, Michael Dwyer wrote:
> This is done with the Apache Redirect directive.  This is somewhat
> dangerous, though.  It seems to hit on a substring search.  So in the
> example mbutcher gave you, it might actually loop.  This would be a Bad
> Thing(tm).  As usual, though, try it out.  It may work just fine for
> you!

It may be _possible_, but not likely (in the same way that it is possible to 
make a meta redirect circular). It's not just a plain substring search. It's 
a path search. The Apache manual gives details:

http://httpd.apache.org/docs/mod/mod_alias.html#redirect

I guess HTTP 301 is what you want. That will change the location in the URL 
field, as well as map the base URI to the redirected path. 302 would probably 
work fine as well... but I'm not sure what the base URI becomes in the case 
of a 302.

HTTP spec. defines all the HTTP codes (most 300s are redirects):
ftp://ftp.isi.edu/in-notes/rfc2616.txt

> For myself, I use a meta refresh to do it.  Once they load the first
> page, they are redirected off to the real address.  This is often
> annoying to people who bookmark the page, and is certainly annoying to
> anyone who tries to use the BACK button to get passed this redirect...
> but it works. <shrug>

This is a pet peeve of mine. If you don't have a way to modify the server 
config, do this. Otherwise, don't drive everyone nuts by preventing them from 
using the back button.

Matt



More information about the NCLUG mailing list