2017-05-27 21 views
0

我想在我的項目任何方式刪除index.php文件,而無需使用htaccess文件中笨

我剛剛打開CodeIgniter的文件夾中htdocs並粘貼此代碼的URL刪除index.php

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
#RewriteRule .* index.php/$0 [PT,L] 
#RewriteRule ^(.*)$ index.php/$0 [PT,L] 
RewriteRule ^(.*)$ index.php/$0 [QSA,L] 
#RewriteRule ^(.*)$ index.php?/$1 [L] 
#RewriteRule ^(.*)$ index.php/$1 [L] 
+1

沒有,我們不要 –

+0

刪除這是不是一個笨的功能,它是一個Web服務器功能。它必須通過.htaccess文件完成。 – Joe

回答

0

基於codeigniter documentation,您必須添加以下代碼的.htaccess文件

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