Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache SetEnv prepends REDIRECT_ . What gives?

Tags:

php

apache

setenv

For an application based on Zend Framework I use apaches SetEnv in .htaccess. I use this on test, staging and production servers like so:

SetEnv APPLICATION_ENVIRONMENT production

On the staging server I couldn't read this env var in PHP. However when I did a var_dump( $_ENV ) in php I got the value but the key was prepended with REDIRECT_ becoming

REDIRECT_APPLICATION_ENVIRONMENT

Can anybody explain why this is happening, and how I can prevent this?

like image 732
Decent Dabbler Avatar asked Feb 15 '10 18:02

Decent Dabbler


1 Answers

I'm guessing you have mod_rewrite rules in your .htaccess as well for Zend? I believe it may be mod_rewrite prepending that when it does a redirect so that the value won't be overridden by any new settings with the new URL.

like image 136
nortron Avatar answered Sep 21 '22 13:09

nortron