Skip to content

Instantly share code, notes, and snippets.

@golman
Last active August 29, 2015 14:05
Show Gist options
  • Save golman/7fe4d2a56e89c9d77448 to your computer and use it in GitHub Desktop.
Save golman/7fe4d2a56e89c9d77448 to your computer and use it in GitHub Desktop.
base_url для CodeIgniter, независимый от домена
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment