Redirect with docker label: ?PageSpeed=noscript to none

Hey ho,

I am trying to redirect permanently my urls to remove ?PageSpeed=noscript from the url, but I am not able to do this. Right now my goal was to remove PageSpeed=noscript so that the questionmark or "and" sign would stay, but even that did not work.

What am I doing wrong?

Here my code:

      traefik.http.middlewares.middleware1.redirectregex.permanent: "true"
      traefik.http.middlewares.middleware1.redirectregex.regex: "PageSpeed=noscript"
      traefik.http.middlewares.middleware1.redirectregex.replacement: ""

Perhaps this is not the best solution, but this is the solution that I thought would be the best...

How would you do this?

Have a nice day together and stay healthy,

Bastian

Is the solution you wan't to replace "?PageSpeed=noscript" with ""?
When using docker labels it seems like you have to escape the questionmark multiple times.
So

      traefik.http.middlewares.middleware1.redirectregex.permanent: "true"
      traefik.http.middlewares.middleware1.redirectregex.regex: "\\\\?PageSpeed=noscript"
      traefik.http.middlewares.middleware1.redirectregex.replacement: ""

should work. If it don't then try it with only two backslashes "\?PageSpeed=noscript"