It seems environment variables don't work as expected on LiteSpeed and aren't compatible with the way Apache does things.
I have this, which works on Apache:
Searching around brought up that LiteSpeed doesn't handle SetEnvIf at all and that it should be done with rewriterules. The problem is that it doesn't work either:
Furthermore, setting an environment variable and using it in, for example, PHP doesn't work either:
Any pointers on how to solve these two issues?
I have this, which works on Apache:
Code:
SetEnvIf Request_URI "^/path/to/admin.*$" adminUri
AuthName "Password protected"
AuthType Basic
AuthUserFile ./.htpasswd
Require valid-user
Order Deny,Allow
Deny from all
Allow from env=adminUri
Satisfy any
Code:
RewriteRule ^/path/to/admin - [E=AppDisablePasswordProtect:1]
AuthName "Password protected"
AuthType Basic
AuthUserFile ./.htpasswd
Require valid-user
Order Deny,Allow
Deny from all
Allow from env=AppDisablePasswordProtect
Satisfy any
Code:
RewriteRule (.*) - [E=FOO:BAR]
PHP:
<?
print_r($_ENV);