The easiest solution would be to put /user
as the first part of the URL. However, I can understand the appear for mydomain.com/username
.
What you can do is make your first rule a catch-all rule that treats all requests tha get to it as a request for a user page. Remember that Phalcon's router matches the last route first, so your first route will be matched last. For example:
$Router->add('rule for usernames'); // checked last
$Router->add('rule for confirm'); // checked second
$Router->add('rule for email'); // checked first
You can make your rule regex really generic, then specify the "user" controller when that route is matched.