Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

docmd.close 2585, WWWXXXAPC, WWWXXXDOCO, nu vot, dhcpd lease file "binding state", WWWXXXDOCO, how to setup procmail to process html2text, how to setup procmail html2text, WWWXXXAPC., XXXCNZZZ



#1: mod_rewrite problem with LA-U:REMOTE_USER

Posted on 2003-12-19 03:34:05 by John McManigle

Hi all,

I've had the toughest time trying to get mod_rewrite to work...

My specific goal: set up a system whereby a user is sent to his/her
own home directory upon authenticating.

Problem: It seems that however I configure things, apache takes
%{LA-U:REMOTE-USER} as empty. (Also tried just %{REMOTE_USER} )

System: Running Debian GNU/Linux Stable, with Apache installed
from the testing tree using apt-get. All other apache features
seem to work just fine, including other RewriteRules.
Server version: Apache/2.0.47
Server built: Jul 15 2003 13:47:34

Attempts to solve & details:

I've searched the apache docs as well as this list's archives, and
it looks like the biggest hint is to do the lookahead thing rather
than just %{REMOTE_USER} Tried that, doesn't work for me.

I'm putting my Rewrite statements in the virtual host file. Some
of the permutations I've tried are:

RewriteLog /var/log/apache/myrewritelog
RewriteLogLevel 9
RewriteEngine on

RewriteRule ^/home/(.*) /~%{LA-U:REMOTE_USER}/$1

RewriteRule ^/home/(.*) /~%{REMOTE_USER}/$1

RewriteRule ^/home/(.*) /~%{LA-F:REMOTE_USER}/$1

RewriteRule ^/home/(.*) /~%{ENV:REMOTE_USER}/$1

RewriteRule ^/home/(.*) /~%{la-u:remote_user}/$1

RewriteCond %{la-u:remote_user} (.+)
RewriteRule ^/home/(.*) /~%1/$1 [R]

In all of these cases, it acts as though the remote user variable
is empty. The client does authenticate correctly, and going to an
environment-printing CGI gives


Looking at the rewrite log, we have things like this (a bit snipped):

[18/Dec/2003:18:56:15 --0500] (2) init rewrite engine with requested
uri /home/
[18/Dec/2003:18:56:15 --0500] (3) applying pattern '^/home(.*)' to uri
[18/Dec/2003:18:56:15 --0500] (5) lookahead: path=/home/
var=REMOTE_USER -> val=
[18/Dec/2003:18:56:15 --0500] (2) rewrite /home/ -> /~/

So clearly, this is incorrect....

Any suggestions about why this might be going bad, why I *can* see
the variable in a CGI, etc?

Thanks a lot for reading this far :-) I hope there's some help out

John McManigle
Student Sysop and Webmaster
Montgomery Blair High School

------------------------------------------------------------ ---------
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:

Report this message