[CLUE-Tech] redirection question for Apache

Dave Anselmi anselmi at americanisp.net
Sun Nov 4 18:28:19 MST 2001


jason at matchingmoms.com wrote:

> My default home page is /var/www/html/index.hmtl.  To test redirection using
> the HTTP_EQUIV tag I created the following index.html:

Depending on what you're goal is, there is another way to do this.  The
HTTP-EQUIV tag is a way to put http header info into html.  The browser treats
both of them the same, but generally header fields are generated by the server
so html authors are unaware of them.  Apache uses redirects (in the http header)
for various things (see the Redirect directive, and mod_rewrite and mod_alias).

If you are programming (you mentioned perl), you may come across a case where
you want to send a redirect to the client.  If you have access to the http
response (the data structure or object that represents what the server is going
to send), you can set the redirect field there, and not have to deal with
programmatically generating the html that does the same thing.  This makes it
easy to fit redirects into your request handling framework.

Java (running in a servlet engine) will give you a response object, and I'm sure
perl has something similar.  A side effect of using the http header is that
there is no body, so you don't get a "please wait" page.  Perhaps that's what
you want, perhaps not.  There are some other, subtle, differences in how
browsers handle the two methods, so if one doesn't do what you want, try the
other.

Dave





More information about the clue-tech mailing list