简体   繁体   English

Codeigniter - 4.2 - 404 提交后找不到文件

[英]Codeigniter - 4.2 - 404 File not found on post submit

I just made a new installation of Codeigniter 4.2.我刚刚安装了 Codeigniter 4.2。 It worked fine.它运作良好。 Then, I copied the controllers, models and views from my existing project in Codeigniter 4.1.9.然后,我从 Codeigniter 4.1.9 中的现有项目中复制了控制器、模型和视图。

The application loads fine.应用程序加载正常。 When the application makes post submit, it always shows 404 - File not found.当应用程序提交后,它总是显示 404 - 找不到文件。

I have set the routes->setAutoRoute(true);我已经设置了 routes->setAutoRoute(true); in Routes.php and Set $autoRoutesImproved to true in `app/Config/Feature.php.在 Routes.php 中,并在 `app/Config/Feature.php 中将$autoRoutesImproved设置为 true。

Still getting the same error.仍然出现相同的错误。

Since v4.2.0, Auto-Routing has been disabled by default.从 v4.2.0 开始,Auto-Routing 默认关闭。 Because it is easy to create vulnerable apps where controller filters or CSRF protection are bypassed.因为很容易创建易受攻击的应用程序,绕过 controller 过滤器或 CSRF 保护。

But if you want to run v4.1.9 apps, you need to set $routes->setAutoRoute(true) in Routes.php and set $autoRoutesImproved to false in app/Config/Feature.php .但是如果你想运行 v4.1.9 的应用程序,你需要在 Routes.php 中设置$routes->setAutoRoute(true)并在app/Config/Feature.php中设置$autoRoutesImprovedfalse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM