Skip to content

Instantly share code, notes, and snippets.

@lanuma
Created November 1, 2017 13:46
Show Gist options
  • Save lanuma/8e54eda99b8ee568ffac4153064c3f5d to your computer and use it in GitHub Desktop.
Save lanuma/8e54eda99b8ee568ffac4153064c3f5d to your computer and use it in GitHub Desktop.
Multi Site domain for CI 3
// 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