Welcome Guest, Not a member yet? Register   Sign In
HTTPS
#8

Got it. This is what I use on one of the most recent sites:
PHP Code:
if (isset($_SERVER['HTTP_HOST'])) {
    
$config['base_url'] = (isset($_SERVER['HTTPS']) ? "https://" "http://") . $_SERVER['HTTP_HOST'] . '/';
} else {
    
// CLI tool
    
$config['base_url'] = '';


Not sure if it works on all configurations, but I get by on my local XAMPP and production server.

I guess long term it's not the most elegant solution, because it has to do a check and calculation for every request and it would be much better to just say base_url = X, but it works and probably doesn't affect the loads speed overall that much.
Reply


Messages In This Thread
HTTPS - by ignitedcms - 09-10-2018, 09:12 AM
RE: HTTPS - by Pertti - 09-10-2018, 11:34 AM
RE: HTTPS - by ignitedcms - 09-10-2018, 12:34 PM
RE: HTTPS - by php_rocs - 09-10-2018, 12:39 PM
RE: HTTPS - by ignitedcms - 09-10-2018, 12:43 PM
RE: HTTPS - by php_rocs - 09-10-2018, 01:19 PM
RE: HTTPS - by ignitedcms - 09-10-2018, 01:22 PM
RE: HTTPS - by Pertti - 09-10-2018, 02:12 PM
RE: HTTPS - by ecampait - 09-10-2018, 02:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB