Welcome Guest, Not a member yet? Register   Sign In
Cant set CI_ENVIRONMENT
#6

(06-07-2020, 06:10 PM)thingNumber1 Wrote:
(06-07-2020, 06:05 PM)John_Betong Wrote: I prefer setting the  .htaccess generated $_SERVER variable in index.php.

Both, $_SERVER and $_ENV are prefixed with `REDIRECT_`

Code:
<?php // index.php
  define('LOCALHOST', 'localhost'===$_SERVER['SERVER_NAME']);

// DEFAULT TO ONLINE
  $_SERVER['CI_ENVIRONMENT'] = 'production';
  if(LOCALHOST) :
    $_SERVER['CI_ENVIRONMENT'] = 'development';
  endif;
Reply


Messages In This Thread
Cant set CI_ENVIRONMENT - by thingNumber1 - 06-07-2020, 10:48 AM
RE: Cant set CI_ENVIRONMENT - by InsiteFX - 06-07-2020, 12:39 PM
RE: Cant set CI_ENVIRONMENT - by thingNumber1 - 06-07-2020, 01:04 PM
RE: Cant set CI_ENVIRONMENT - by John_Betong - 06-07-2020, 06:05 PM
RE: Cant set CI_ENVIRONMENT - by thingNumber1 - 06-07-2020, 06:10 PM
RE: Cant set CI_ENVIRONMENT - by John_Betong - 06-08-2020, 12:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB