在 Codeigniter 中删除 index.php 时出错

Error while removing index.php in Codeigniter

当我尝试使用 .htaccess 文件中的以下代码从 Codeigniter url 中删除 index.php 时,我的项目文件夹隐藏了。

.htaccess 代码(来自 codeigniter 用户指南):

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

我的 localhost 当我不使用上面的代码时(一切正常):

我的 localhost 当我将该代码添加到我的 .htaccess 文件时(我无法访问我的项目文件夹):

解决方案:

我忘记在 wamp 服务器中从我的 Apache 模块启用 rewrite-module,这就是问题所在!

谢谢大家。