Java Mailing List Archive

http://www.apache-httpd.com/

Home » users.httpd »

[users@httpd] SetEnvIf question

Lars

2008-07-18


Author LoginPost Reply
Hello!

I want to combine some settings in my httpd.conf and .htaccess file. Example;

In my httpd.conf I have:
<Directory "/www/html/secure">
Order deny,allow
deny from all
</Directory>

And I want to be able to allow some users, and I want do define them
in the .htaccess file.. I also want that _if_ the .htaccess file gets
deleted or anything, the config from httpd.conf take over and denies
people.

Well, this is how I want to do this;

I'm using mod_rewrite to set some enviroment variables based on
cookies, example:
RewriteRule .* - [E=AUTHED:OK,C]
RewriteCond %{HTTP_COOKIE} !^.*auth=ok.*$
SetEnvIf ${AUTHED} OK AUTHED

I want the httpd.conf to have something like:
Order Deny,Allow
deny from all
allow from env=AUTHED

So in the .htaccess file, I set the E=AUTHED enviroment variable, that
works fine. But I not able to get it in the httpd.conf later, nor if I
test and put the httpd.conf later in the .htaccess file.

I have also tried stuff like "SetEnvIf E=AUTHED OK AUTHED" but without luck..

How can this be done?

Thanks
Lars

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@(protected)
 "  from the digest: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.