[eluser]paulopmx[/eluser]
How about this:
$url = $_SERVER['SCRIPT_NAME'];
$url = substr($url,0,strpos($url,".php"));
$url = substr($url,0,(strlen($url) - strpos(strrev($url),"/")));
$url = ((empty($_SERVER['HTTPS']) OR $_SERVER['HTTPS'] === 'off') ? 'http' : 'https')."://".$_SERVER['HTTP_HOST'].$url;
$config['base_url'] = $url;
Will let your app work even if its inside a subfolder, or if its not using index.php as a loader.