Can catch-all segments contain static nested routes? ([...slug]/stats) #85372
-
QuestionI'm trying to create a routing structure similar to npm's package pages, where I need to handle:
Proposed file structureMy understandingBased on the documentation about catch-all segments, I know that:
However, I couldn't find clear documentation about whether static routes can be nested inside a catch-all segment folder. Questions
Additional contextI found conflicting information suggesting that catch-all segments "must be at the end" and cannot contain other folders, but I'm not sure if this applies to static routes or only to other dynamic segments. Any clarification would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Yes, catch-all routes can have static nested routes. For example, [...slug]/stats will match URLs like /blog/2025/post/stats with [...slug] catching the preceding segments and stats as a static nested page. |
Beta Was this translation helpful? Give feedback.
Yes, catch-all routes can have static nested routes. For example, [...slug]/stats will match URLs like /blog/2025/post/stats with [...slug] catching the preceding segments and stats as a static nested page.