Define environment variable outside mod_rewrite

If a user doesn't have mod_rewrite enabled, the environment variable will never be set, causing the application to always run in production mode.