重新安装的 WAMP 现在无法打开我的项目重定向到 index.php

Reinstalled WAMP now can't open my project redirects to index.php

我刚刚重新安装了 wamp 并试图打开我的 CI 项目。我打开项目的默认页面,但是当我单击任何 link 时,它会重定向到 wamp 的项目列表页面。假设默认页面是登录然后它打开但是当我点击登录时它会将我重定向到 wamp 的默认索引页面我搜索堆栈并发现将其从 true 更改为 false 可能会有所帮助。

$suppress_localhost = false;

但这对我不起作用。我认为可能的原因可能是我在 Codeigniter 项目中的 .htaccess 文件。这是它的代码:

<IfModule mod_rewrite.c>
    RewriteEngine On
    # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
    #  slashes.
    # If your page resides at
    #  http://www.example.com/mypage/test1
    # then use
    # RewriteBase /mypage/test1/
    RewriteBase /crm/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/ [L]
  </IfModule>

  <IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
  </IfModule>

请帮我解决这个问题。

默认情况下,WAMP 的 Apache 重写模块处于关闭状态。尝试打开它,然后重新启动服务。您可以在托盘菜单(Apache -> Apache 模块)中打开该模块,或者在 httpd.conf 文件中取消注释此行:"LoadModule rewrite_module modules/mod_rewrite.so"。希望对你有帮助。