Welcome Guest, Not a member yet? Register   Sign In
On CI3.0.3 Base URL
#1

(This post was last modified: 11-15-2015, 09:34 PM by seasenx6.)

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.
Reply
#2

Setting BASE_URL
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Thank you, InsiteFx :')
Reply




Theme © iAndrew 2016 - Forum software by © MyBB