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. |
Messages In This Thread |
On CI3.0.3 Base URL - by seasenx6 - 11-15-2015, 09:16 PM
RE: On CI3.0.3 Base URL - by InsiteFX - 11-16-2015, 05:20 AM
RE: On CI3.0.3 Base URL - by seasenx6 - 11-16-2015, 09:42 PM
|