Codeigniter check https and http url

application>config>config.php

$http_tag = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");

if($http_tag =='http'){
$config['base_url'] = 'http://' . $_SERVER["HTTP_HOST"] . '/project';
}else{
$config['base_url'] = 'https://' . $_SERVER["HTTP_HOST"] . '/project';
}

Blogbook : PHP | Javascript | Laravel | Corcel | CodeIgniter | VueJs | ReactJs | WordPress