[solved] htaccess SetEnv

#1
Hello,

Due to the increased number of users on our web page, we have to migrate it from Apache to Litespeed. However, there is one problem: we use SetEnv commands within htaccess file in order to set some environment variables, for ex:

SetEnv USER user1

This works well in Apache, but not in Litespeed - it has no effect. We have tried lots of other commands using RewriteRules, such as:

RewriteRule ^ - [E:USER=user1]
RewriteRule . - [E:USER=user1]
RewriteRule ^(.*) [E:USER=user1]
RewriteRule ^(.*) - [E:USER=user1]

... and so on, but none of them sets the environmental variables. Obviously I do call "RewriteEngine On" before calling RewriteRule commands.

I can list all the environmental variables using phpinfo() call, but none of the entries within .htaccess sets any of the variables. I can set these directly within the php code ($_SERVER['USER'] = "user1"; ) and it works fine.

I have looked all over the internet and couldn't find a solution that works from the .htaccess. Can you advise please?

Thanks!
 
Last edited by a moderator:
#3
Not working

Under Apache the following line works perfectly:
RewriteRule ^(.*) - [E:USER=user1]

Under Litespeed it doesn't set anything.

I also tried your suggestion, that doesn't set the variable either.

Any other suggestions?
 
Top