#Dynamic catch-all routes with further child pages?

2 messages · Page 1 of 1 (latest)

austere vale
#

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?

wide bluffBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)