httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: Making mod_auth_digest mysql
Date Fri, 06 Feb 2009 14:23:38 GMT
On Fri, Feb 6, 2009 at 8:49 AM, Michele Waldman <mmwaldman@nyc.rr.com> wrote:
> I mean to check server environment variables which is what REMOTE_USER is.

This might be better off on users@httpd.apache.org

> I just want to know if the variable is defined on the server then I could do
> this:
>
> RewriteEngine On
> RewriteCond %{REMOTE_USER} -e

I couldn't find any reference to "-e", to check if it's empty you can
do !="" or !^$

> RewriteRule ^(.*)$ - [S=1]
> RewriteRule ^.*$ http://domain/login.html [R]
>
> Right now when REMOTE_USER is not defined this line gets executed:
> RewriteRule ^(.*)$ - [S=1]
>
> I want that line to be skipped if REMOTE_USER has not been defined as a
> server environment variable.

In per-vhost context, that will never be set unless you use the
lookahead feature.

>
> You can see the values in phpinfo();  It is only defined if the user is
> logged in.

That processing is later, so REMOTE_USER may be set by then.

> Why would a nonexistent variable evaluate to true?

Unless i'm confused re: "-e", It  seems like your "-e" would be
interpreted as a regex, but that shouldn't match an empty string
AFAICT.


-- 
Eric Covener
covener@gmail.com

Mime
View raw message