Closed marwanehcine closed 1 year ago
I have tested this and it works, but I think the regex is misleading. Something like that would be clearer IMO:
- "traefik.http.middlewares.add-trailing-slash.redirectregex.regex=^https?://(.+)/([^?]+)(\\?.*)?$"
- "traefik.http.middlewares.add-trailing-slash.redirectregex.replacement=https://$${1}/$${2}/$${3}"
Here we add a third capturing group containing query params, which we reappend after the trailing slash. What do you think @marwanehcine?
I have tested this and it works, but I think the regex is misleading. Something like that would be clearer IMO:
- "traefik.http.middlewares.add-trailing-slash.redirectregex.regex=^https?://(.+)/([^?]+)(\\?.*)?$" - "traefik.http.middlewares.add-trailing-slash.redirectregex.replacement=https://$${1}/$${2}/$${3}"
Here we add a third capturing group containing query params, which we reappend after the trailing slash. What do you think @marwanehcine?
can you please continue this PR here : https://github.com/georchestra/docker/pull/197 to not have duplicates
to fix infinite redirection when path root contains query params, traefik redirection rules in docker-compose.override.yml has to be updated. A new regex formula is used to check is query param exist or not