Codeigniter .htaccess无法正常工作,显示“500 Internal Server Error”消息

时间:2013-04-05 18:47:36

标签: php .htaccess codeigniter

我正在使用wamp,在我的www文件夹中,我在文件夹名称 ci 下安装了codeigniter。在使用 .htaccess 之前,我的codeigniter工作正常,我可以在运行项目时看到codeigniter welcome messege。在 ci 目录中创建 .htaccess 文件后,运行项目时总是会出现“500内部服务器错误”。 这是我的 config.php 文件的一部分 -

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

这是我的 .htaccess 文件 -

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /ci/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

这是我的apache错误日志消息 -

    [Sat Apr 06 00:04:47 2013] [alert] [client 127.0.0.1] C:/wamp/www/ci/.htaccess: RewriteEngine not allowed here, referer: http://localhost/

我还在apache中启用了rewrite_module。 现在我还能做些什么呢?我希望有人帮助我

N.B。我的codeigniter版本2.1.3,Apache版本:2.2.11,PHP版本:5.3.1,MySQL版本:5.1.32

1 个答案:

答案 0 :(得分:0)

ci目录上下文

中需要AllowOverride All
<Directory /path/to/ci>
    Options FollowSymLinks
    AllowOverride all
    # any other options/directives needed
</Directory>