Next.js Discord

Discord Forum

Capture sub path in route

Unanswered
Grass carp posted this in #help-forum
Open in Discord
Grass carpOP
This might seem like a strange use-case so feel free to make any suggestions. I'm building a shopping cart with different steps based on a products configuration. I'd like to use /checkout/[productId] but as well as that store the current step in the URL . Would it be possible to ignore a chunk of the route beyond the [productId] segment and handle it programatically? e.g. /checkout/[productId][...remainder of route]. I'm finding it hard to reconcile everything to a folder structure.

3 Replies