tags:

views:

201

answers:

1

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 
RewriteRule ^loading$ /images/loading.gif [NC,L]

for some reason going to

/loading

does not show the loading.gif

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

A: 

You need to set the environment variable with mod_rewrite too:

RewriteRule ^ - [E=APPLICATION_ENV:production]
Gumbo
Exceptional! How did you know that, I haven't seen that in the documentation...
Just did some testing.
Gumbo