how to codeigniter base_url set on localhost code example
Example 1: codeigniter base_url
$this->load->helper('url');
Example 2: 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.