Routes error |
Problems with $routes - any idea
When i add $routes->add('demo', 'Test'); $routes->add('demosub', 'Test::subtest'); the url https://bitest.ugent.be/demosub works the url https://bitest.ugent.be/test/subtest does not work. When I remove the routes https://bitest.ugent.be/test/subtest will work again. I have made a copy without the routes https://bitest.ugent.be/testother/subtest no htaccess in de root. htaccess in public folder (WWW) see https://codeshare.io/G743bj Routes files : https://codeshare.io/ax0nEB Test controller : https://codeshare.io/aJLJnZ CI4 V4.1.2 - fresh rollout via composer
I wanted to explain the reason, but it takes a long time.
Therefore I say shortly. Don't use auto-detecting routes + wildcard route (add() method) Replace the add() method with the appropriate HTTP method. https://github.com/codeigniter4/CodeIgni...ssues/4711
problem solved.
Changed to PHP Code: $routes->match(['get', 'put'],'demo', 'Test'); both urls are working now the url https://bitest.ugent.be/demosub the url https://bitest.ugent.be/test/subtest |
Welcome Guest, Not a member yet? Register Sign In |