2013-12-18 50 views
1

我正在使用codeigniter。我成功刪除了localhost上的index.php,但它不適用於遠程服務器。Codignier無法刪除遠程服務器上的index.php

當我嘗試打電話時:http://website.com/user/login它給了我[文件未找到]。但是,它的工作原理,當我鍵入:http://website.com/index.php/user/login

我把所有文件上的WWW文件夾,這是我的.htaccess:

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

誰能幫幫我好嗎? 謝謝。

回答

1

這是我的.htaccess使用:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

你檢查你的.htaccess文件是在遠程服務器上正確的,它正在讀?

+0

謝謝!它現在有效;) –

+0

很高興聽到:) – JoJo

0

這個工作對我來說:

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

而在你的config.php

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

這會從本地主機都與遠程服務器刪除的index.php