URI Routing — CodeIgniter 4.1.4 documentation
To overcome this, CodeIgniter allows you to remap the URI handler. ... This would handle a resource route to the AppAPIv1Users controller with the /api/users URI. You can also use a specific filter for a group of routes. This will always run the filter before or after the controller. This is especially handy during authentication or api logging: