htaccess: set and use environment variables inside your htaccess

A while ago I learned how to set a variable in my .htaccess that can later on be user in PHP:

.htaccess

PHP:

Something that I could not figure out was how to use the defined variable inside the htaccess. While searching for CORS implementation, I ran across this post on stackoverflow.com:

There there is the answer to my question, how to set and get an environment variable in htaccess:

Leave a Reply

Your email address will not be published. Required fields are marked *

IMPORTANT! To be able to proceed, you need to solve the following simple math (so I know that you are a human) :-)

What is 3 + 9 ?
Please leave these two fields as-is: