Next.js Discord

Discord Forum

replace existing query params with routes without much pain?

Unanswered
maslomeister posted this in #help-forum
Open in Discord
I have few pages with logic built arund query params, Is there a quick and easy way to replace this
/route?test=jarvis&duration=1month with this /route/jarvis/1month in server components
?

3 Replies

@maslomeister use a middleware
Make it listen to requests starting with /route
Then just get all the search params and redirect with them