• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
On CI3.0.3 Base URL

#1
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.