LinkedNestBlog

Codeigniter index.php 제거

by 이진원Dev
Codeigniter index.php 제거

Ref.] http://www.codeigniter-kr.org/bbs/view/lecture?idx=7073


* bitnami 환경 기준
  1. apache/conf/하위의 httpd.conf 파일 수정
    1. 경로
      /Applications/mampstack-5.6.20-0/apache2/conf
    2. 수정 내용 
      1. mod_rewrite.so 주석 제거
      2. AllowOverride 수정
        AllowOverride All
  2. apache 서버 재시작
    1. 경로
      /Applications/mampstack-5.6.20-0/apache2/scripts
    2. 실행 스크립트
      ./ctl.sh stop
      ./ctl.sh start
  3. config.php  수정
    1. 경로 : 
      /Applications/mampstack-5.6.20-0/apache2/htdocs/application
    2. 수정 내용 :
      $config['index_page'] ='' 로 수정
  4. .htaccess 파일 생성
    1
    2
    3
    4
    5
    6
    7
    8
    <IfModule mod_rewrite.c>    
        RewriteEngine On 
        RewriteBase / 
        RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt) 
        RewriteCond %{REQUEST_FILENAME} !-f 
        RewriteCond %{REQUEST_FILENAME} !-d 
        RewriteRule ^(.*)$ /index.php/$1 [L]
    </IfModule>
    cs