Skip to content

Instantly share code, notes, and snippets.

@paulobunga
Created October 3, 2017 17:05
Show Gist options
  • Save paulobunga/aceaec81476938c0eda1a730d080635f to your computer and use it in GitHub Desktop.
Save paulobunga/aceaec81476938c0eda1a730d080635f to your computer and use it in GitHub Desktop.
Automatically pick a base url for a codeIgniter project
$config['base_url'] = 'https';
$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