php - 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';
让我知道是否需要任何其他信息。
任何建议,将不胜感激!
谢谢!
解决方案
推荐阅读
- visual-studio - 如何在 Visual Studio 中自动排序和删除未使用的导入?
- mysql - 如何将路径数据转换为邻接表
- javascript - nodejs express客户端在访问main之前无法获取/xxx.html
- google-sheets - 如何根据单元格的值与列平均值的距离更改列的单元格颜色?
- c++ - C++ - 使用代码块,类不能被访问
- sql-server - Go denisenkom/go-mssqldb:mssql:关键字“AS”附近的语法不正确
- postgresql - 如果列以特定模式开头,如何在 PostgreSQL 中删除列
- javascript - 使用 JS 在 Json 数组中对相同 Id 的值求和
- module - 找不到模块'gulp'
- javascript - React Native - 在我的 React Redux 商店中获取“位置”状态