Forum Moderators: phranque
Apache 2.0.52 on Windows
RewriteEngine on
RewriteLog c:\temp\rewrite.log
RewriteLogLevel 9
RewriteCond %{LA-U:REMOTE_USER} (.*)
RewriteRule ^/test.asp(.*) [somehost.com:81...] [P]
It works fine for other variables such as REMOTE_ADDR, REMOTE_HOST and HTTP:HOST but not for REMOTE_USER
I know that REMOTE_HOST is not set in the first phase but using LA-U should help?
The reason for doing this is that I have an old embedded webserver (not the above asp server) that is not capable of reading header variables, only querystrings
Help appreciated
The reason you may have problems with REMOTE_HOST is that the remote hostname must be acquired by your server by doing a reverse-DNS lookup on the REMOTE_ADDR of the incoming client request. Since your Web server must issue a request to your DNS server and wait for a respone, this information is not available until late in the API processing.
There should be no problem accessing REMOTE_USER and putting that info into a query string. I would expect your code to work. Maybe I don't understand your problem, though.
Jim
RewriteEngine on
RewriteLog c:\temp\rewrite.log
RewriteLogLevel 9
RewriteCond %{LA-U:REMOTE_USER} (.*)
RewriteRule ^/test.asp(.*) [somehost.com:81...] [QSA,P,L]
Using LA-U:REMOTE_USER instead of %1
I do not really care why, this works for me, just info to close this one.