Simple condition, which never match and set variable:
SetEnvIf Request_URI "^/path/to/something*" access_granted
Checking URI by using PHP is giving correct string, however variable is never set.
echo getenv('Request_URI'); --> /path/to/something
echo getenv('access_granted'); --> <<empty>>
Simple as that, but still and always failing to match.
Update: interesting point is, that I can achieve access_granted=1 by string:
SetEnvIf Request_URI "^/path/*" access_granted
/path
is also RewriteBase - maybe it's connected somehow, I don't know