# Mod Rewrite Env Variables

## 30 May 2009 - 1 answer

Using this rudimentary example, I can't seem to get Environment Variables to 'take'

``````SetEnv APPLICATION_ENV production
RewriteEngine On
RewriteCond %{ENV:APPLICATION_ENV} =production
``````

for some reason going to

``````/loading
``````

I have tried many permutations of the comparison using the syntax ^production but nothing works

I know just removing the RewriteCond will make it work, but this question is about correctly comparing using an Environment Variable

``````RewriteRule ^ - [E=APPLICATION_ENV:production]