Answers for "how to set base url in codeigniter config file"

0

how to set base url in codeigniter

$base_url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$base_url .= "://". @$_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$config['base_url'] = $base_url;
Posted by: Guest on July-26-2021
1

codeigniter base_url

$this->load->helper('url');
Posted by: Guest on March-06-2020
0

fix working base_url for local and server both in codeigniter

$config['base_url'] = "http://".$_SERVER['SERVER_NAME']."/project_name/";
this way you config you base_url , then won't worry about in hosting. both works in localhost and server.
Posted by: Guest on June-10-2020

Code answers related to "how to set base url in codeigniter config file"

Browse Popular Code Answers by Language