CI default configuration can only be fixed at the time of the URL, HTTP and HTTPS can not even interoperability, the following code is added to the application / config / config.php, and the original $ config [ 'base_url'] commented out, the code It is set according to the URL that users access.
$root = (isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $root;