httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: document_root function
Date Sat, 15 Jun 1996 20:45:37 GMT
On Fri, 14 Jun 1996, Adam Sussman wrote:

> The document_root function in http_core.c has comments that say not to use it.
> Is there any reason for this, or an alternative to this function?

Neat as I can tell, the reason not to use docuemnt_root() is not
because of the function itself, but how it's used. The comment in
http_core.h is more descriptive than the one in http_core.c. Namely:

char *document_root (request_rec *); /* Don't use this!  If your request went
                                      * through a Userdir, or something like
                                      * that, it'll screw you.  But it's
                                      * back-compatible...

Or, in other words, don't make the mistake of thinking that document
root + uri gets you the filename. But I think it's safe to use if you
really do want the document root, for whatever reason.

Alexei Kosut <>      The Apache HTTP Server

View raw message