We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Route Collision


I have these two routes, they both are inside a group route class,

      $this->add('/login', array(
            'controller'    => 'user',
            'action'        => 'login'

and second one after the first one,

        $this->addGet('/{address}', array(
            'controller'    => 'user',
            'action'        => 'profile',
            'address'       => 1

Normally, if a user tries to open: https://www.example.com/login, he/she should see a login page, but it redirects to profile route. Where is the problem?


(As mentioned in the docs) routes are evaluated in reverse order.

It seems your 2nd route matches /login