Next.js Discord

Discord Forum

Use dynamic router instead of index

Answered
Catalan Sheepdog posted this in #help-forum
Open in Discord
Catalan SheepdogOP
Hello, Can I somehow make it so that /3213123123/ directs to [module].tsx instead of index.tsx?
Answered by Ray
or use catch all segment
/page/dashboard/[...params].tsx
/dashboard/323232323/other
{ params: [323232323, other] }
View full answer

10 Replies

Catalan SheepdogOP
I forgot about screenshot
change [id] folder to [module].tsx?
Catalan SheepdogOP
no bc my query can also be /dashboard/3213123123/other
so no for you question
Catalan SheepdogOP
or use catch all segment
/page/dashboard/[...params].tsx
/dashboard/323232323/other
{ params: [323232323, other] }
Answer
Catalan SheepdogOP
it's good idea, tysm!
you could read more about it here
Catalan SheepdogOP
ty