KSK
6/22/2018 - 10:21 AM

20180622 SSL対応 config

/* 本番(https対応)ここから*/
// define('LOCATION', 'https://'.$_SERVER['SERVER_NAME'].str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__)."/.."))).'/', true);


// /* SSL */
// $ssl = str_replace('https', 'https', LOCATION);
// if(empty($_SERVER['HTTPS'])) define('LOCATION_FILE', LOCATION, true);
// else define('LOCATION_FILE', $ssl, true);
/* 本番(https対応)ここまで*/


/* ローカルここから*/
define('LOCATION', 'http://'.$_SERVER['SERVER_NAME'].str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__)."/.."))).'/', true);


/* SSL */
$ssl = str_replace('http', 'https', LOCATION);
if(empty($_SERVER['HTTPS'])) define('LOCATION_FILE', LOCATION, true);
else define('LOCATION_FILE', $ssl, true);
/* ローカルここまで*/