Set an environment variable in .htaccess and retrieve it in PHP

Assuming your configuration has AllowOverrides with .htaccess, you must enable mod_env in Apache for this to work.

Apache – mod_env

Leave a Comment