How To Config Base Url In Codeigniter

[Solved] How To Config Base Url In Codeigniter | Php - Code Explorer | yomemimo.com
Question : how to set base url in codeigniter

Answered by : yawning-yacare-wy3cep27exjh

$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;

Source : https://stackoverflow.com/questions/11792268/how-to-set-proper-codeigniter-base-url | Last Update : Mon, 02 Aug 21

Question : dynamic base url codeigniter

Answered by : confused-chipmunk-nyedd7qqp54w

defined('BASE_URL') OR define('BASE_URL', (is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/');
$config['base_url'] = BASE_URL;

Source : | Last Update : Wed, 09 Dec 20

Question : codeigniter base_url

Answered by : wrong-wolverine-z0nov1pr3sik

$this->load->helper('url');

Source : https://stackoverflow.com/questions/6449386/base-url-function-not-working-in-codeigniter | Last Update : Fri, 13 Mar 20

Question : codeigniter base url automatic

Answered by : harendra

$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;

Source : https://hackeradda.com/read/how-to-set-dynamic-base-url-in-codeigniter | Last Update : Tue, 23 Feb 21

Answers related to how to config base url in codeigniter

Code Explorer Popular Question For Php