On CI3.0.3 Base URL |
If I want using multi protocol -> http and https.
How I config base_url ?? ------------------------------------------------------------------------------------------- from http://www.codeigniter.com/user_guide/in...e_303.html I try $allowed_domains = array('http://mydomain.com', 'https://mydomain.com'); $default_domain = 'http://mydomain.com'; if (in_array($_SERVER['HTTP_HOST'], $allowed_domains, TRUE)) { $domain = $_SERVER['HTTP_HOST']; } else { $domain = $default_domain; } if (!empty($_SERVER['HTTPS'])) { $config['base_url'] = 'https://'.$domain; } else { $config['base_url'] = 'http://'.$domain; } It not work ------------------------------------------------------------------------ Oop, I solution is it success. I change " $default_domain = 'http://mydomain.com'; " to " $default_domain = 'mydomain.com'; ". Multi protocal is work >,,< Thank you.
Setting BASE_URL
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |