0

This is my scenario : there is a source URL like this: shop/Paypal?page=2 I want to redirect to a destination that does not need any query param, like this: http://localhost:3000/shop/visacard/

I tried these two solutions: 1 - adding query matching like this :

has: [
  {
    type: "query",
    key: "page",
  },
]

but the problem is page param appears in the destination which I don't want.

2- secondly I tried to add \\ to my URL according to next js docs to ignore the Regex character and my URL was like this: shop/paypal\?page=2 in this solution, the project runs normally but redirecting does not work at all.

Ahmed Sbai
  • 10,695
  • 9
  • 19
  • 38
  • 1
    Hi Mehdi! Sorry, but in its current state, your question might get downvoted or closed. Please create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) when asking so people can help you better. – Youssouf Oumar Mar 17 '23 at 17:57
  • Does this answer your question? [NEXT JS - How to remove Query Params](https://stackoverflow.com/questions/65606974/next-js-how-to-remove-query-params) – kca Mar 18 '23 at 16:28

0 Answers0