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:11:39 GMT

On Wed, 5 Mar 2003, Michael Klama wrote:

> Owen,
> You are correct in my misunderstanding of what mod_rewrite is capable of
> doing.  What I was trying to do was change the doc root based on the login
> info.  Sorry if I took up your valuable time trying to do something that is
> not possible.  I will try your suggestion regarding creating a separate VH
> for each user for the redirection I am looking for.  Thank you for all of
> your time and help.  I will post with the result so others may use this
> solution in a similar situation.
> -----Original Message-----
> From: Boyle Owen []

> If so, you have a major misunderstanding of mod_rewrite. It rewrites URLs -
> not filepaths. It turns one URL into another URL so the final destination
> still has to be a URL. But you want to change an internal filepath and that
> is not within the scope of mod_rewrite.

I haven't been following this thread, so I may be mistaken about the
context, but I don't believe this is correct.

To put it in Apache terms, mod_rewrite can act either like a Redirect or
an Alias.  Using the [R] flag or supplying an absolute URL causes
mod_rewrite to send a redirect.  Using just a file-system or url-path
causes mod_rewrite to simply deliver the content without redirecting.  In
other words, mod_rewrite can transparently change the content delivered by
a URL without actually changing the URL in the browser.

If my very quick skimming of the thread is correct, then the original
poster's problem is likely that %{REMOTE_USER} is not available in the
server-wide context, because this context is evaluated before the user
authentication is complete.  But there is a way around this: use
%{LA-U:REMOTE_USER} to ask mod_rewrite to perform a "look-ahead" to find
out what the REMOTE_USER will be once auth is complete.

See the mod_rewrite docs for details:
(special note 4).


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