I am trying to set an Env variable in htaccess using rewrite based on the query string. I want to set ENVIRONMENT to mobile if mobile=true in the query string
So far I have tried a few things but am stuck with this rule which I think should work but sadly is not working…
RewriteCond %{QUERY_STRING} !^mobile=true$
RewriteRule .* - [E=ENVIRONMENT:mobile]
Any help appreciated!
Thanks
You made a small typo in the form of a
!that is preventing you from getting the result you’re after.