Welcome Guest, Not a member yet? Register   Sign In
Multi domain in CodeIgniter with http/https
#1

(This post was last modified: 11-20-2018, 12:47 AM by ciadmin. Edit Reason: another link to the torrent site )

Hi all,

I have been used CI for 4 years. Today I will share my config for multi domain + http/https

The environment: CI 2.x/3.x + nginx web server

- In server side (nginx), you should config normal vhost for http/https (you can search with Google)
- In Application side, file config.php


PHP Code:
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
    $protocol_ 'https';
else
    $protocol_ 'http';
$config['base_url'] = $protocol_.'://'.$_SERVER['HTTP_HOST'].'/'

Now you can access your application with many domain:
http://abc.com/
https://abc.com/
**SEO SPAM LINK REDACTED**
http://xyz.com/
https://xyz.com/
And no need config any more in application side

Hope all you like this topic Wink
Reply


Messages In This Thread
Multi domain in CodeIgniter with http/https - by d4jk4 - 10-21-2016, 08:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB