Traefik redirect from one url to url with prefix

Hello guys. We decided to move from subdomain structure to one root domain with path prefixes, but we got many old urls in the internet . So is there any way to add redirect from old url to new one?
For example,
we got subdomain switched to, i can access correctly site with string in docker yaml file
traefik.frontend.rule:;PathPrefixStrip:/test, but when im trying to add to traefik config
redirects like

    regex = "^https://(*)"
    replacement = "^${1}"

traefik says that it doesn't know where to forward this request
If im trying to add traefik.frontend.rule:,;PathPrefixStrip:/test
traefik adds prefix to both hosts. Is there anyway to resolve this without adding second reverse proxy?


middlewares are only in Traefik v2.