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

[eluser]renownedmedia[/eluser]
[quote author="bargainph" date="1244011796"]
Code:
$config['base_url']    = ((empty($_SERVER['HTTPS']) OR $_SERVER['HTTPS'] === 'off') ? 'http' : 'https').'://'.$_SERVER['HTTP_HOST'].'/';
[/quote]

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

I just derived mine from yours so that it works within sub-directories. Have you had servers report $_SERVER['HTTPS'] as 'off'? Mine have always not had it set when in HTTP!


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



Theme © iAndrew 2016 - Forum software by © MyBB