2013-12-18 51 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