Header Ads

CI 다중 사이트 설정

코드이나이터는 하나만 인스톨을 하고,
여러 사이트를 서브도메인으로 연결하여 사용하려면
index.php 파일의 application_folder를 다음 처럼 수정하면 된다.

/*
 *---------------------------------------------------------------
 * APPLICATION FOLDER NAME
 *---------------------------------------------------------------
 *
 * If you want this front controller to use a different "application"
 * folder than the default one you can set its name here. The folder
 * can also be renamed or relocated anywhere on your server. If
 * you do, use a full server path. For more info please see the user guide:
 * http://codeigniter.com/user_guide/general/managing_apps.html
 *
 * NO TRAILING SLASH!
 */
// $application_folder = 'application';
 switch($_SERVER['HTTP_HOST'])
 {
  case('www.a.com') : 
   $application_folder = 'www.a.com';
  break;
  case('www.b.com') : 
   $application_folder = 'www.b.com';
  break;
  case('www.c.com') : 
   $application_folder = 'www.c.com';
  break;
  default : 
   $application_folder = 'application';
 }

No comments

Copyright 2016, minki. All rights reserved. Powered by Blogger.