It can be due to server redirection also.
Please check phpinfo output and check $_SERVER['REDIRECT_MAGE_IS_DEVELOPER_MODE']
variable also.
Explanation :
If You are working with the Apache module mod_rewrite and want to set some environment vars, the Apache manual says these vars could be accessed in CGI using $ENV{VAR}
. In PHP You might want to write $_ENV['VAR']
to get the value of VAR, but You have to access if via $_SERVER
, and in some different ways :
- Example: .htaccess and example.php
RewriteEngine on
RewriteRule ^?var1=([^;]);var2=([^;])$ \
- [E=VAR1:$1,E=VAR2:$2]
- Example: .htaccess and index.php
RewriteEngine on
RewriteRule ^index.php$ - [L]
RewriteRule ?var1=([^;]);var2=([^;])$ \
index.php [E=VAR1:$1,E=VAR2:$2]
Note: If any RewriteRule matches, an internal redirect than restarts (after the last defined rule, or immediately after the matched rule having a L-flag) checking the entire rule set again. For an internal redirect, every defined VAR gets an 'REDIRECT_' prefix, i.e. VAR1 will be REDIRECT_VAR1, VAR2 will be REDIRECT_VAR2.
Of course, You can (additionally) redefine the original VAR:
RewriteEngine on
RewriteRule ^index.php$ \
- [E=VAR1:%{REDIRECT_VAR1},E=VAR2:%{REDIRECT_VAR2},L]
RewriteRule ?var1=([^;]);var2=([^;])$ \
index.php [E=VAR1:$1,E=VAR2:$2]
With this, You will have $_SERVER['REDIRECT_VAR*']
and $_SERVER['VAR*']
.
The given examples are only for explanation, in any case, they are not intended to fit Your needs. The "\" in the .htaccess examples are only for display purpose, they should not occur in a real .htaccess file. The argument separator ';' in links can also be '&', but this may cause some trouble with HTML/XHTML. See the following pages for more information about this issue: