In config.php
$config[\'base_url\'] = \'http://localhost/codeigniter/\';
In View
You need to add url helper in config/autoload
$autoload['helper'] = array('form', 'url', 'file', 'html'); <-- Like This
Then you can use base_url or any kind of url.