httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject RE: [users@httpd] problem configuring mod_rewrite rule
Date Wed, 05 Mar 2003 16:46:45 GMT

On Wed, 5 Mar 2003, Boyle Owen wrote:

> >-----Original Message-----
> >From: Joshua Slive []
> >
> >I haven't been following this thread, so I may be mistaken about the
> >context, but I don't believe this is correct.
> My understanding is that the poster wants to create the effect that the
> website belongs to each individual user. So "fred" and "joe" can login
> and type the same URLs but get different pages (Is this correct,
> Michael?). This came across as a desire to change the Docroot based on
> %{REMOTE_USER}. I think I'm right that you can't change the Docroot on
> the fly!

Well, "docroot" here is kind of an ambiguous concept.  No, you can't
change the DocumentRoot directive, nor the DOCUMENT_ROOT env variable on
the fly.  But you can effectively change the directory from where apache
serves files, which amounts to the same thing.

The following should work, but I haven't tested it:

DocumentRoot /home/web/fallback-location/

# First do a security check: we have a username, and it
# doesn't contain anything funky like ".." or "/".
RewriteCond %{LA-U:REMOTE_USER} ^[a-zA-Z0-9]+$
# Then change the path based on the user name
RerwiteRule (.*) /home/web/users/%{LA-U:REMOTE_USER}$1


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message