首页 > 解决方案 > Codeigniter:404 页面未找到:/index

问题描述

Codeigniter404 Page Not Found: /index为所有 404 路由抛出错误,而它应该抛出404 Page Not Found: controller/action

当前误差

ERROR - 2020-03-12 13:54:44 --> 404 Page Not Found: /index

预期错误

ERROR - 2020-03-12 13:54:44 --> 404 Page Not Found: controller/action

请在下面找到我的代码和配置

操作系统:Windows 10(64 位)

Mod_Rewrite:我在 Apache 中启用了 Mod_Rewrite 模块

Codeigniter 版本:3.1(HMVC 架构)

PHP版本:5.6.32

公共\.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    RewriteRule ^vendor/(.*)?$ / [R=301,L]
</IfModule>

应用程序\配置\config.php

$config['base_url'] = 'http://site.local/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

让我知道是否需要任何其他信息。

任何建议,将不胜感激!

谢谢!

标签: php.htaccesscodeignitermod-rewrite

解决方案


推荐阅读