httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 26052] DOCUMENT_ROOT environment variable set incorrectly with VirtualDocumentRoot
Date Wed, 10 Nov 2010 15:08:58 GMT

arcadius <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #30 from arcadius <> 2010-11-10 10:08:51 EST ---
Another solution is to satisfy feature request "change DOCUMENT_ROOT via

Currently mod_rewrite's directive "RewriteRule <src> <target>
[E=DOCUMENT_ROOT:<desired value>]" creates environment variable
'REDIRECT_DOCUMENT_ROOT' if <target> is redirected by other directives; else it
has no effect, DOCUMENT_ROOT is overwritten by Apache.

Let's suppose that setting of environment variable DOCUMENT_ROOT by mod_rewrite
will be processed in new special way (all other env. variables should not be
affected): Apache changes its inner DOCUMENT_ROOT for current request to the
value set by mod_rewrite, and corrects DOCUMENT_ROOT-relative paths (PATH_INFO,
SCRIPT_NAME). Both inner Apache settings & corresponding environment variables
should be corrected. If correction fails - return 500 Internal Server Error.

Advantages of such solution:
1. Very small backward compatibility issue.
If somebody tried to set DOCUMENT_ROOT by mod_rewrite, failed, but launched his
experiment to production server(s) - he will have compatibility issue.
So to be affected, one must have done very atypical & silly thing.

2. Administrators will be able to set correct DOCUMENT_ROOT value for
VirtualDocumentRoot-s in configuration files,

3. Administrators & hosting customers with limited rights will be able to
create subdomains by mod_rewrite.
Currently this great Apache & mod_rewrite feature is not perfect: everything
can be tuned (there are some tricks) except correcting DOCUMENT_ROOT.
Kial's workaround is good for PHP scripts, but f.e. doesn't solve issue with
listing of directory's content within subdomain with "Options +Indexes"
(example: ).

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message