title: Redirect URL to another URL by regex with Traefik
body: <p>I want to redirect one URL to another URL through traefik.</p>
  
  <p>I am using docker for this configuration and below is my docker-compose.yml file </p>
  
  <pre><code>version: '3'
  
  services:
    reverse-proxy:
      # The official v2.0 Traefik docker image
      image: containous/whoami
      container_name: "whoami_cont"
      # Enables the web UI and tells Traefik to listen to docker
      ports:
        # The HTTP port
        - 80:80
        # The Web UI (enabled by --api.insecure=true)
        - 8080:8080
      labels:
        - traefik.http.middlewares.test-replacepathregex.replacepathregex.regex=^(https?|ftp|file)://[-a-zA-Z0-9+&amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&amp;@#/%=~_|]
        - traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement=http://localhost:8081/4
  </code></pre>
  
  <p>then I am running docker-compose command successfully. Then I am going to hit any URL which matching regex pattern but URL is not redirecting to another URL - <a href="http://localhost:8081/4" rel="nofollow noreferrer">http://localhost:8081/4</a> as per configuration.
  I am using traefik version 2.0</p>
  
  <p>Please let me know if any configuration is missing.</p>