Base URL should be absolute, including the protocol:
$config['base_url'] = "http://somesite.com/somedir/";
If using the URL helper, then base_url()
will output the above string.
Passing arguments to base_url()
or site_url()
will result in the following (assuming $config['index_page'] = "index.php";
:
echo base_url('assets/stylesheet.css'); // http://somesite.com/somedir/assets/stylesheet.css
echo site_url('mycontroller/mymethod'); // http://somesite.com/somedir/index.php/mycontroller/mymethod
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…