Forked from onubadev/gist:3ba272d8cee68dcc49892d22e7bac4fd
Last active
August 27, 2018 16:56
-
-
Save otengkwame/9dfd82c506b7f192126d4cad7e689793 to your computer and use it in GitHub Desktop.
Codeigniter dynamic HTTP/HTTPS base url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in config.php | |
$base_url=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST']; | |
$base_url.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); | |
$config['base_url'] = $base_url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment