Search code examples
phpcodeignitercodeigniter-4

Codeigniter - 4.2 - 404 File not found on post submit


I just made a new installation of Codeigniter 4.2. It worked fine. Then, I copied the controllers, models and views from my existing project in Codeigniter 4.1.9.

The application loads fine. When the application makes post submit, it always shows 404 - File not found.

I have set the routes->setAutoRoute(true); in Routes.php and Set $autoRoutesImproved to true in `app/Config/Feature.php.

Still getting the same error.


Solution

  • Since v4.2.0, Auto-Routing has been disabled by default. Because it is easy to create vulnerable apps where controller filters or CSRF protection are bypassed.

    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.