Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Categories as the first level subdirectory


I have some routes in my app including:



Now I also want my categories (e.g. programming, physics, biology, ...) use the first level subdirectories (our SEO person has requested this). I mean we can have (to show list of programming discussions) (to show list of physics discussions)

The problem is that if I define a route as following, even the login and users actions are forwarded to this route


The order of route definition (i.e. the priority) is not considered. If it was considered, I could first define /login and /users and then /{category} at the end.

What can I do to solve this problem?


Reverse the order in which you define your rules. By default, the router evaluates rules from bottom to top, in order of definition.


Thank you very much. That solved the problem.