Next.js Discord

Discord Forum

dynamic routes

Unanswered
Shawty posted this in #help-forum
Open in Discord
how would i create a dynamic route like /something/[id]/something

ive tried [[...id]].tsx but it just responded with a 404 on any page

2 Replies

Nest a folder named something inside the [id] folder.

You should have a page.tsx file at this path: /app/something/[id]/something/page.tsx
So if you had two IDs, id1 and id2, the generated pages would be these:
- domain.com/something/id1
- domain.com/something/id1/something
- domain.com/something/id2
- domain.com/something/id2/something