질문 Q #12166
CI 서브디렉토리에 배포 질문이요.~~
무무 2015-04-16 10:46:17

도와 주세요..  ㅠㅠ  
호스팅받아 운영중인 시스템이있는데요
그 안에 서브로 디렉토리를 만들어 CI를 설치를 했더니 계속 404만 뜨네요. 

예 :
운영 : www.test.com
CI를 설치하여 별도로 운영하고싶은 도메인  : www.test.com/test123

찾아봐야될것들이 또 있는지. 아님 잘못 처리한게 있는지 궁금합니다. 


작업은 글들을 찾아봐서 아래와 같이 처리는 해봤어요. 
1. config.php
if($_SERVER["SERVER_ADDR"] == "127.0.0.1")
{
    $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
    $config['base_url'] .= "://" . $_SERVER['HTTP_HOST'];
    $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']);
}
else
{
    $config['base_url']    = 'http://www.test.com/test123/';
}


$config['index_page'] = '';


2. .htaccess

<IfModule mod_rewrite.c> 
Options +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} =localhost
RewriteRule . - [E=REWRITEBASE:/]

RewriteCond %{HTTP_HOST} =www.test.com
RewriteRule . - [E=REWRITEBASE:/test123/]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|essets|images|img|js|css|captcha|data|include|uploads|robots\.txt)
RewriteRule ^(.*)$ %{ENV:REWRITEBASE}index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 /
</IfModule>





 

 

답변 3
#1 한대승(불의회상) 2015-04-16 12:23:21
.htaccess의 내용을 아래처럼 바꿔 보세요.

RewriteEngine On

RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]
#2 무무 2015-04-16 12:59:16

감사합니다만 .. 잘 안되네요. 

test123이 사용중인 도메인 루트 하단에 폴더를 만든거구요. 
거기에 코드이그나이터를 설치하고싶은거라서요 ... 

 

참 어렵네요 ㅠㅠ

#3 샤오란 2015-04-16 16:34:49
index.php가 있는 디렉토리(test123)에
.htaccess 파일 생성후

RewriteEngine On
RewriteCond $1 !^(/test123/index\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /test123/index.php/$1 [L]