2016-09-05 78 views
-1

我無法從CodeIgnitor 3.0 URL中刪除index.php。我已經應用了很多解決方案,但沒有任何成效我正在使用WAMP 2.5。 rewrite_module在Apache中處於活動狀態。 $ config ['index_page'] =''。我htaccess文件是在根文件夾是如下無法從Codeignitor 3.0 URL中刪除index.php

RewriteEngine on 
RewriteBase /Reporting/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt) 
RewriteRule ^(.*)$ /yourfolder/index.php/$1 [L] 

報告是在WWW,所有的文件都存在的文件夾。

+1

的[笨去除URL的index.php]可能的複製(http://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url) – RiggsFolly

回答

0

我有與默認的.htaccess代碼刪除的index.php的問題,但我設法這就是我的.htaccess現在的樣子。

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


<Files "index.php"> 
AcceptPathInfo On 
</Files> 
</IfModule> 

<IfModule !mod_rewrite.c> 

ErrorDocument 404 /index.php 
</IfModule> 
+0

謝謝朋友。我已經做了。現在工作正常。 – Vivek

0

與此代碼在.htaccess嘗試

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

你笨文件中有這樣的 - READ

+0

我已經嘗試過這一點,但沒有工作。 – Vivek

+0

您是否試過這種方法 - http://stackoverflow.com/a/28828919/6042030 – vip88