/ Published in: PHP

More info found in the link above, basically, you can replace the $config['base_url'] to the snippet below and you no longer need to set the base url. Useful for making your application more portable.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
URL: http://codeigniter.com/wiki/Automatic_configbase_url/
Comments
