SetEnv doesn't seem to work for me. I tried this in my .htaccess:
SetEnvIf Remote_Addr ^192\.168\.0$ ip_ok
<IfDefine !ip_ok>
AuthName "Guest Login"
AuthType Basic
AuthUserFile /opt/lampp/lib/ok_users/guests.users
require valid-user
</IfDefine>
and I had to provide username/password credentials even though my ip is 192.168.0.10 and the server (centos5 / xampp for linux 1.6.8a) is 192.168.0.1
So I tried this:
SetEnv ip_ok
<IfDefine !ip_ok>
AuthName "Guest Login"
AuthType Basic
AuthUserFile /opt/lampp/lib/ok_users/guests.users
require valid-user
</IfDefine>
but setenv does not set ip_ok, and I still get challenged.
Then I tried this:
SetEnv ip_ok
<IfDefine ip_ok>
AuthName "Guest Login"
AuthType Basic
AuthUserFile /opt/lampp/lib/ok_users/guests.users
require valid-user
</IfDefine>
and I don't get challenged. Therefore IfDefine is working.
Any ideas why I can't get SetEnv and SetEnvIf to work?? I've googled and read but can't crack it.