2017-04-03 126 views
1

我想刪除hmvc代碼點火器中的index.php,當我在沒有index.php的情況下輸入url時,它運行良好,但是當我處理到其他控制器時,url自動顯示index.php後codeigniter文件夾。在hmvc中刪除index.php

例如I型:

localhost/ci_hmvc/user/login 

,結果當我處理到其他控制器是:

localhost/ci_hmvc/index.php/user/dashboard 

和我的.htaccess

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /ci_hmvc/index.php/$1 [L] 
</IfModule> 

請任何一個幫助我

+0

是否有login.php控制器上的重定向? – Calvin

回答

0

你可以使config.php這是在config文件夾的變化 你可以看到線

$config['index_page'] = 'index.php'; 

改變這一行中

$config['index_page'] = ''; 

我希望這將有助於你

+1

,並檢查你有什麼base_url –

+0

多數民衆贊成在幫助完整,謝謝 –

0

把這個代碼在.htaccess並將htaccess文件放在文件夾的根目錄下。

DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]