![]() |
On CI3.0.3 Base URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: On CI3.0.3 Base URL (/showthread.php?tid=63576) |
On CI3.0.3 Base URL - seasenx6 - 11-15-2015 If I want using multi protocol -> http and https. How I config base_url ?? ------------------------------------------------------------------------------------------- from http://www.codeigniter.com/user_guide/installation/upgrade_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. RE: On CI3.0.3 Base URL - InsiteFX - 11-16-2015 Setting BASE_URL RE: On CI3.0.3 Base URL - seasenx6 - 11-16-2015 Thank you, InsiteFx :') |