apache - Environment variable value as RewriteCond -


i have following rewrite rule in place:

rewritecond %{http_host} . rewritecond %{http_host} !^www\.domain\.com rewritecond %{http_host} !^static\.domain\.com rewriterule ^(.*)$ http://www.domain.com/$1 [l,r=301] 

for development purposes, environment variable app_env = development set in vhosts.conf

is possible use value of app_env rewrite condition? i.e, not want redirected in development environment.

i have tried following, perhaps ignorantly?

rewritecond %{env:app_env} !^development 

thanks

for whatever reason, setenv (mod_env) gets applied after mod_rewrite does, however, mod_setenvif gets applied before. need:

setenvif request_uri ^ appenv=development 

in vhost file. setenv won't set value until after mod_rewrite has been applied.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -