0

我正在使用 wamp 并且在我的 www 文件夹中,我在文件夹名称ci下安装了 codeigniter 。在使用.htaccess之前,我的 codeigniter 工作正常,运行项目时我可以看到 codeigniter 欢迎消息。在ci目录中创建.htaccess文件后,我在运行项目时总是收到“500 Internal Server Error”。这是我的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。现在我还能做什么?我希望有人帮助我

注意我的 codeigniter 版本 2.1.3,Apache 版本:2.2.11,PHP 版本:5.3.1,MySQL 版本:5.1.32

4

1 回答 1

0

您需要AllowOverride Allci目录上下文中

<Directory /path/to/ci>
    Options FollowSymLinks
    AllowOverride all
    # any other options/directives needed
</Directory>
于 2013-04-05T19:27:31.393 回答