Most people need those query parameters so it’s probably by design. As far as I know, you can probably only get rid of it client-side, that is using JavaScript.
The issue is that the name can contain a dot and when it’s passed as query param the page is not found. Everything is ok when the dot is not present. I can’t handle it when it’s automatically passed when redirecting.
If the dot is passed as the parameter, it will redirect to the path with the dot. The only option is to not pass a dot or as I said before, you’d have to rely on JavaScript. Removing parameters on redirect won’t help with the dot, I suppose.
It’s ok when the dot is in the URL path. However, page not found when it’s in the query params. And it’s only present on netlify. When I try it locally, everything is fine.
Everything is ok with the redirect and the query params passed over to another route. I was wrong about the issue. The issue is that netlify doesn’t accept the query params that contains the dot. This issue should be closed now.
Thank you!
[[redirects]]
status = 301
from = "/"
query = {kategoria = ":kategoria", oldal = ":oldal"}
to = "/.netlify/functions/redirect/?kategoria=:kategoria&oldal=:oldal"
[[redirects]]
status = 301
from = "/"
query = {kategoria = ":kategoria"}
to = "/.netlify/functions/redirect/?kategoria=:kategoria"
I’d like to end up with: /muveszeti-tevekenyseg/
Where the old site has: ?kategoria=eletrajz&oldal=muveszeti
But I get: /muveszeti-tevekenyseg/?kategoria=eletrajz&oldal=muveszeti
I tried this on production now and turns out, you’re correct, the parameters are preserved. However, they’re not preserved if you add some other parameters. You can seem the complete code here: