httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Ionescu" <bobsie...@googlemail.com>
Subject Re: Using AuthName with mod_rewrite
Date Thu, 18 Dec 2008 11:19:52 GMT
> When I use
> RewriteEngine on
> RewriteCond %{REMOTE_USER} ^

That RegEx is always true (so you can skip the condition). To check
for at least one character present, use a '.', i.e.
%{REMOTE_USER} .

But anyway...

> RewriteRule  ^/$   http://localhost/home.seam?userid=%{REMOTE_USER} [L]

That is per-server context (which is a good idea to use) but auth and
access checks are done on a per-directory basis. That means, that the
ENV cannot be present in per-server context, i.e. before auth is being
processed. There are two possible solutions:

Use an URL-based subrequest in per-server context do determine the
value of that ENV:
RewriteRule  ^/$ http://localhost/home.seam?userid=%{LA-U:REMOTE_USER} [R,L]

-or-
use the rule in per-directory context

<Directory /path/to/docroot>
RewriteEngine on
RewriteRule  ^$ http://localhost/home.seam?userid=%{REMOTE_USER} [R,L]
</Directory>

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message