2013-02-01 5 views
1

가능한 중복 :
How to remove “index.php” in codeigniter’s path는 CodeIgniter의에서 index.php를 제거하려고

1.create 다음 코드

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /ex/ 
    RewriteCond $1 ^(application|system|private|logs) 
    RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L] 
    RewriteCond $1 ^(index\.php|robots\.txt|opensearch\.xml|favicon\.ico|assets|forums) 
    RewriteRule ^(.*)$ - [PT,L] 
    RewriteRule ^(.*)$ index.php/$1 [PT,L] 
    </IfModule> 

와 CodeIgniter의 디렉토리에 htaccess로 파일 2. config['index_page']='index.php'config['index_page']=''

로 변경하십시오.

하지만 작동하지 않습니다. 내 httpd.conf 파일은 (/ 등/아파치 /)

답변

0

당신이 당신의 아파치 모듈에 rewrite_module을 활성화 한

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

이 있는지 확인하십시오 당신의 .htaccess 파일이 시도 비어

RewriteEngine On 
RewriteBase /ex/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
0
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 
관련 문제