2013-12-23 126 views
0

我只是將我的codeigniter項目部署到託管服務器。我有這個問題。Codeigniter部署index.php顯示404錯誤

通過右邊的鏈接應該在這方面的工作 - >http://test.com/quiz/test

當我部署我需要密鑰此則可以正常工作。 http://test.com/quiz/index.php/test

這是我的服務器層次

public_html 
|-css 
|-js 
|-index.php 
|-quiz 
|---application 
|---system 
|---index.php 
|---.... 
|---.htaccess 

這是我的htaccess

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

是正確的嗎?

+0

確認mod_rewrite已在服務器上啓用了,那麼你可能只需要重新啓動服務器 –

回答

0

在你的htaccess試試這個,這個工作對我來說:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 

同時,將您的htaccess測驗文件夾內沒有應用程序文件夾。

+0

您好,感謝您的建議,我已經嘗試過仍然無法訪問。然後我嘗試這一點,工作RewriteEngine敘述上 RewriteBase /測驗/ 的RewriteCond%{} REQUEST_FILENAME!-f 的RewriteCond%{} REQUEST_FILENAME!-d 重寫規則^(。*)$ /quiz/index.php?$1 [L] 。謝謝 – user236501

0

將文件名更改爲第一個字母的上限和類名稱。

例如:mas_unit_ctrl變化Mas_unit_ctrl