The URL I'm using is, let's say, example.com/subdir/index.php?foo=bar
index.php contains this: <?php echo getenv("testenvvar"); ?>
I'm setting an enviroment variable in .htaccess like so:
SetEnvIf Request_URI (index) TestEnv=Worked
This prints "Worked".
If I change it to SetEnvIf Request_URI (bar) TestEnv=Worked
, it does not.
How can I do this?
Another option would be SetEnvIfExpr:
SetEnvIfExpr "%{QUERY_STRING} =~ /bar/" TestEnv=Worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With