2011-07-08 22 views
0

我正在部署我們在現場服務器中創建的Web應用程序,但是後來在解決如何刪除index.php時遇到了麻煩。 我已閱讀了幾個關於如何在codeigniter應用程序中刪除index.php的博客。無法刪除CodeIgniter應用程序中的index.php

我有我的.htaccess

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

,並在我的config.php

$配置[ 'index_page'] = '' 試過這個設置;

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

但我仍然無法弄清楚如何刪除它。我需要編輯Apache httpd.conf中的內容嗎?

謝謝!

+0

你有mod_rewrite啓用你的apache服務器? – Endophage

回答

0

你可以嘗試刪除?這是後您的.htaccess的index.php存在:

變化:

RewriteRule ^(.*)$ index.php?/$1 [L] 

要:

RewriteRule ^(.*)$ /index.php/$1 [L] 
+0

我已經改變了的.htaccess到這個設置 RewriteEngine敘述在 RewriteBase/ 的RewriteCond%{REQUEST_URI} ^系統。* **重寫規則^(。*)$ /index.php/$1 [L] ** 的RewriteCond %{REQUEST_URI}^application。* ** RewriteRule ^(。*)$ /index.php/$1 [L] ** RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d ** RewriteRule ^(。*)$ index.php/$ 1 [L] **仍然沒有任何反應 – nhoyti

+0

[CodeIgniter](http://codeigniter.com/user_guide/general/urls.html)網站上提到以下設置: 'RewriteEngine on' 'RewriteCond $ 1!^(i ndex \ .php | images | robots \ .txt)' 'RewriteRule ^(。*)$ /index.php/$1 [L]' –

0

這是我使用的一個。嘗試了3個不同的之前,我發現一個工作

DirectoryIndex index.php 
RewriteEngine on 

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