Next.js Discord

Discord Forum

How I can use static url params for filtering data?

Answered
Vadym posted this in #help-forum
Open in Discord
Hello everyone!
I’m looking for advice, on how I can make filters exactly this way:

https://mydomain.com/new-york/pizza/30-30

I have the option to make it via optional catch-all segments, but I don’t have an idea how to do it without additional attachments (like /pages/pizza/[[…pizza]].page.tsx)

Thanks in advance for any suggestions!
Answered by joulev
you have to use catch-all segments here, like [[...pizza]] that you said above, if you want to accept /new-york/pizza/30-30 and /30-30/new-york and /pizza/30-30 and so on at the same time.

if not, why not just [location]/[name]/...?
View full answer

2 Replies