Welcome Guest, Not a member yet? Register   Sign In
Improvement for ENVIRONMENT definition
#1

Hi,

I am running CI 3.0.2 on a shared host server.

I've defined CI_SERV in .htacces, like this:
Code:
SetEnv CI_ENV "testing"
However, looking at phpinfo I get a variable REDIRECT_CI_ENV and not CI_ENV !

So I would suggest the following modification in index.php (line 56) for next CI versions:

Code:
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : (isset($_SERVER['REDIRECT_CI_ENV'])?$_SERVER['REDIRECT_CI_ENV']:'development'));


Cheers,
L@u
Reply
#2

From http://stackoverflow.com/questions/30504...hat-causes

Quote:Adding the following to the start of the rewrite rules recreates the original ENV:VAR on each redirect (as well as leaving the REDIRECT_VAR versions there) if they're needed:

Code:
RewriteCond %{ENV:REDIRECT_VAR} !^$
RewriteRule .* - [E=VAR:%{ENV:REDIRECT_VAR}]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB