Skip to content

Instantly share code, notes, and snippets.

@accessomnath
Created February 9, 2020 09:21
Show Gist options
  • Save accessomnath/d3d216204ed043c7db7e73ea03eed08b to your computer and use it in GitHub Desktop.
Save accessomnath/d3d216204ed043c7db7e73ea03eed08b to your computer and use it in GitHub Desktop.
$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