Welcome Guest, Not a member yet? Register   Sign In
base_url really necessary?
#3

[eluser]WanWizard[/eluser]
Alternatively, use this:
Code:
if(isset($_SERVER['HTTP_HOST']))
{
    $config['base_url'] = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
    $config['base_url'] .= '://'. $_SERVER['HTTP_HOST'];
    $config['base_url'] .= isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '80' ? ( ':'.$_SERVER['SERVER_PORT'] ) : '';
    $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}
else
{
    $config['base_url'] = 'http://localhost/';
}

Which sets the base_url to whatever it gets passed from the webserver.

For my database.php we use what n0xie's suggests: it's not in our repository, it gets generated when you run the application setup.


Messages In This Thread
base_url really necessary? - by El Forum - 06-16-2010, 02:28 AM
base_url really necessary? - by El Forum - 06-16-2010, 03:13 AM
base_url really necessary? - by El Forum - 06-16-2010, 03:22 AM
base_url really necessary? - by El Forum - 06-16-2010, 08:39 AM
base_url really necessary? - by El Forum - 06-16-2010, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB