How do I rewrite a path based on the request's host?

I have a situation where I would like to pass a request like to http://internal-service/something-dynamic/resource/

Yet, from reading the documentation I cannot find any way to:

  1. Use the match from my router's HostRegexp rule in a middleware (e.g. addPrefix)
  2. Read the Host or Host Header in a ReplacePathRegex middleware
  3. Use any of the Redirect* middleware without issuing a 30* response

Is this even possible with Traefik?

For the sake of completeness, this is what I would like to do in configuration:

      rule = "HostRegexp(`{bucketName:[a-z\\-]+}.demo.localhost`)"
      middlewares = ["addBucket"]
      service = "demo"

      # this obviously does not work
      prefix = "/{bucketName}/"

      passHostHeader = false
        url = ""