Codeigniter在localhost中的url上没有index.php但在服务器中没有工作

时间:2013-08-14 16:09:04

标签: php codeigniter

我试图解决这个问题的2天豆。 我需要从URL中删除index.php, 我的conf很好

$config['base_url'] = 'http://mywebsite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

(我更改了uri_protocol并尝试了所有建议的值)

.htaccess文件很适合,

我尝试了很多关于.htaccess的建议,这是最后一个:

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

这里是文件的配置:

- bin
- etc
- mail
- public_ftp
- public_html
 -- application
 -- assets
 -- system
 -- .htaccess
 -- index.php

如您所见,我的应用程序位于public_html文件上,我的服务器正在使用cpanel accelerator 2进行配置,我无法访问httpd.conf以查看AllowOverride是否已设置到ALL

我怎么能解决这个问题?

1 个答案:

答案 0 :(得分:0)

我有同样的问题。你能否展示一下你的虚拟主机文件? 编辑:添加了我的主题主题CodeIgniter index.php URL rewriting OVH

第二次编辑: 尝试删除你的.htaccess上的第一个/像这个RewriteRule ^(。*)$ index.php / $ 1 [L]