Skip to content

Is SetEnv Supported by LiteSpeed?

The SetEnv directive is not supported by LiteSpeed Web Server. However, you can set environment variables using a RewriteRule in your .htaccess file as an alternative.

Add the following line to your .htaccess file to set an environment variable:

RewriteRule .* - [E=myenv:myvalue]

Replace myenv with the name of your environment variable and myvalue with the desired value.

RewriteEngine On
RewriteRule .* - [E=DB_HOST:localhost]
RewriteRule .* - [E=APP_ENV:production]