Next.js Discord

Discord Forum

Next 13 App Router - Dynamic Route

Answered
Capelin posted this in #help-forum
Open in Discord
CapelinOP
Hi, I created a folder structure like this

app
  | - dashboard
              | - product
                        | - [id]
                               | - page.tsx
                        | - new
                              | - page.tsx


But when I tried to go to /dashboard/product/new it routed to the dynamic route, is it possible to make the folder structure like this ?

How can I go new page
Answered by aardani
try removing .next folder
View full answer

10 Replies

a temporary solution could be to manually check in the [id] route and check if id query string is "new" and then just return that page
CapelinOP
yey, I'm thinking of that way. But is it has a normal way? like a solution from the framework. Or it doesn't support this feature for now :3
i remember reading that it is one of the last things that it does, but i can't find that 😭 right now, so idk
as in nextjs pages it does that: https://codesandbox.io/s/shy-lake-j20v0 (a random codesnadbox i found)
try removing .next folder
Answer
and if it doesn't work try canary version and then bug report @aardani?
yeah
minimal repro repo first
@aardani try removing `.next` folder
CapelinOP
omg, solved. Thank you so much 🙏