Mike521 - 8:37 pm on Dec 6, 2012 (gmt 0)
I am trying to do mobile browser detection in our .htaccess file by setting an environment variable that will be picked up by our website later. We need to create the variable in the vhost file, otherwise it won't be available at all to our ecommerce system (although PHP scripts can see it).
So the variable is created in vhost and is visible to PHP and to our ecommerce system. Next step is to try to modify it with .htaccess. I can do a SetEnv with no problem, PHP shows the new value. But if I do a SetEnvIfNoCase, the value remains unchanged every time. I've verified that my case evaluates to true by setting a completely new variable and checking it with PHP - that variable is correctly set. So for example, assume the variable in vhost is called 'myOldVariable':
#Fails - does not modify the variable:
SetEnvIfNoCase User-Agent "chrome" myOldVariable=A
#Succeeds - creates a new variable with value 'A'
SetEnvIfNoCase User-Agent "chrome" myNewVariable=A
#Succeeds - modifies the variable