Welcome Guest, Not a member yet? Register   Sign In
Automatically change $config['base_url'] when site is uploaded
#1

[eluser]renownedmedia[/eluser]
I made the following change to the config.php file so that when I upload a codeigniter file to any web server, it will automatically change the base_url() output. I can't really see a need to ever manually define this anyway...

Code:
$config['base_url'] = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace("index.php", "", $_SERVER['PHP_SELF']);

Anyone have any reasons this is a bad idea? It also works very well with the base href code:

Quote:<base href="<?=base_url();?>" />


Messages In This Thread
Automatically change $config['base_url'] when site is uploaded - by El Forum - 06-02-2009, 07:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB