Dynamic catch-all routes with further child pages?
Unanswered
Thrianta posted this in #help-forum
ThriantaOP
Hi, I am using Next 13 with App Router and have a page that can take any path (pages are managed dynamically in a CMS, with no depth limit). On certain page types, there are more child path segments after the actual page. For example, I might have a page which contains certain assets. The URL for this might look like this:
Note that the catch-all segment can contain multiple levels. How can I do this with App Router? When I try to have a folder structure like this:
app
- [...catch].tsx
- assets
- page.tsx
Then I want a request to
domain.tld/<catch all segment>/assets/imagesNote that the catch-all segment can contain multiple levels. How can I do this with App Router? When I try to have a folder structure like this:
app
- [...catch].tsx
- assets
- page.tsx
Then I want a request to
domain.tld/a/b/c/assets/images to render page.tsx in the assets folder. Instead, everything is handled by the catch-all. Is there any way to do this?1 Reply
@Thrianta Hi, I am using Next 13 with App Router and have a page that can take any path (pages are managed dynamically in a CMS, with no depth limit). On certain page types, there are more child path segments after the actual page. For example, I might have a page which contains certain assets. The URL for this might look like this:
`domain.tld/<catch all segment>/assets/images`
Note that the catch-all segment can contain multiple levels. How can I do this with App Router? When I try to have a folder structure like this:
app
- [...catch].tsx
- assets
- page.tsx
Then I want a request to `domain.tld/a/b/c/assets/images` to render page.tsx in the assets folder. Instead, everything is handled by the catch-all. Is there any way to do this?
I don’t think what you want to do is possible. Instead just handle this manually in the catch-all