Next.js Discord

Discord Forum

Dynamic Pages routes with very similar path parts

Unanswered
Highlander posted this in #help-forum
Open in Discord
HighlanderOP
This feels like I n00b question, which tells me I'm probably not alone, and maybe just missing it somewhere.

Suppose I have a legacy site, using a config-based routing system, for which the following two paths run different code:

- /path/to/ITEM.111
- /path/to/ITEM.111.details

It's not clear to me how to have those two paths handled "separately" with Pages Router, or even App Router dynamic paths.

E.g., I think my only option is something like /path/to/[itemCapture] and then dealing with parsing itemCapture inside a Page, and sussing out alternate components and props accordingly.

What do you think? Am I overlooking something? Or is this a "rough edge" here in Next?

0 Replies