Created
February 3, 2017 10:41
-
-
Save onubadev/3ba272d8cee68dcc49892d22e7bac4fd 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 | |
$root=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST']; | |
$root.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); | |
$config['base_url'] = $root; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment