Replies: 2 comments 2 replies
-
That's just not how it works. The router finds the first route that matches the URL. Then the dispatcher discovers the route doesn't exist and does a 404. Fortunately, the order in which routes are matched is defined - last first. So you want to add your routes from most generic to most specific. In this case, add your |
Beta Was this translation helpful? Give feedback.
2 replies
-
You can try using a routing middleware. It should check the existence of slug and return |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
when using placeholders for module, controller or action i'd expect that a rule should not match if the requested URI parts do not fit an existing combination of those.
Instead the router matches the pattern anyway and then forwards internally to the 404, despite the presence of a rule with less precedence which would match and work as expected.
Consider the following ruleset for example:
In this scenario the first rule will never match because of the second, which matches the same regex essentially.
Why is the router not moving to the next rule if the specified controller does not exist?
How can i make this work as expected?
Below i can show how i solved it to make it work in the meantime but it's not the same:
Beta Was this translation helpful? Give feedback.
All reactions