Next.js Discord

Discord Forum

Optional Catch-all Segments

Answered
Common carp posted this in #help-forum
Open in Discord
Avatar
Common carpOP
Hi guys, I have a question. If I access /shop, will page.tsx in shop folder or [[...slug]] folder be rendered? I have tried to test it but got an error 404. Can anyone help me explain it ?
Image
Image
Answered by ReverseGem7
Delete the
app/shop/Page.tsx
View full answer

4 Replies

Avatar
I think the error is because u have 2 Pages on /shop
app/shop/[[...slug]]/page.tsx

And
app/shop/page.tsx
Avatar
Delete the
app/shop/Page.tsx
Answer
Avatar
/* all of these urls will be mapped to:
/app/blog/[[...url]]/page.js */
/blog
/blog/one
/blog/one/two
/blog/any/numberOf/params/here
Avatar
Common carpOP
It worked. Thank you