At the first step I changed the database vars.
Code: Select all
$config['dbms'] = 'mysqli';
if ($_SERVER["SERVER_NAME"]=="LocalHostName" || $_SERVER["SERVER_NAME"]=="www.LocalHostName") {
$config['db_hostname'] = 'LocalHostName';
$config['db_username'] = 'LocalUserName';
$config['db_password'] = 'LocalPassword';
$config['db_name'] = 'LocalDBName';
$config['dev'] = true;
} else {
$config['db_hostname'] = 'RemoteHostName';
$config['db_username'] = 'RemoteUserName';
$config['db_password'] = 'RemotePassword';
$config['db_name'] = 'RemoteDBName';
$config['dev'] = false;
}
Within the next step I get the root url and the root path automatically.
Code: Select all
$config['root_url'] = "http://".$_SERVER["SERVER_NAME"];
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}
$config['root_path'] = $_SERVER["DOCUMENT_ROOT"];
The last step is to change all fixed pathes to dynamical pathes, for example:
Code: Select all
$config['previews_path'] = $config['root_path']."/tmp/cache";
Find the complete config.php attached.
What do you think, is there anything wrong with that?