Created
November 1, 2017 13:46
-
-
Save lanuma/8e54eda99b8ee568ffac4153064c3f5d to your computer and use it in GitHub Desktop.
Multi Site domain for CI 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.php | |
$domain = $_SERVER['SERVER_NAME']; | |
$site_id = 0; // default | |
switch ($domain) | |
{ | |
case 'www.domain1.com': | |
$site_id = 1; | |
break; | |
case 'www.domain2.com': | |
$site_id = 2; | |
break; | |
default: | |
show_error('No Site Found'); | |
break; | |
} | |
define('SITE_ID', $site_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment