2010-05-03 98 views
1

我試圖從CI Url中刪除'index.php'。刪除CodeIgniter中的index.php

我已經嘗試了很多解決方案,他們都沒有工作。我已經在 'config.php中' 設置這些變量:

$config['index_page'] = ""; 
$config['uri_protocol'] = "REQUEST_URI"; 

而且我目前的.htaccess是:

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/

RewriteCond %{HTTP_HOST} ^plugb.com$ [NC] 
RewriteRule ^(.*)$ http://www.plugb.com/$1 [R=301,L] 

RewriteCond $1 !^(index\.php|files|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

www前綴部分工作正常。但'index.php'部分沒有。如果您想查詢的網頁,這裏是:http://www.plugb.com/index.php/home

+0

http://stackoverflow.com/a/11106074/984422 – 2012-10-16 08:03:19

回答

3

把你的應用程序文件夾出的系統文件夾,並使用此代碼:

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

它應該工作。