Welcome Guest, Not a member yet? Register   Sign In
Routes error

(This post was last modified: 05-20-2021, 12:51 PM by Bart Goossens.)

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

(This post was last modified: 05-20-2021, 02:48 PM by iRedds.)

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.

Thumbs Up 

problem solved.
Changed to
PHP Code:

both urls are working now
the url https://bitest.ugent.be/demosub
the url https://bitest.ugent.be/test/subtest

Theme © iAndrew 2016 - Forum software by © MyBB