<p>I have traefik installed via the helm chart.</p>
<p>I have a domain: <strong>example.com</strong></p>
<p>It has some blog posts.</p>
<p>I now created a subdomain: <strong>subdomain.example.com</strong></p>
<p>I have the list of my blogs urls:</p>
<pre><code>/blog-1
/blog-2
</code></pre>
<p>Both the base domain and the subdomain are on the same cluster.</p>
<p>I want to have 301 redirects so that if someone tries to visit:</p>
<pre><code>example.com/blog-1
</code></pre>
<p>they would be redirected to:</p>
<pre><code>subdomain.example.com/blog-1
</code></pre>
<p>I do not want to direct with a wildcard just with my list of blog urls.</p>
<p>Thanks</p>
<p>Here is my middleware for redirect to https</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: https-only
  namespace: exmaple
spec:
  redirectScheme:
    scheme: https
    permanent: true
</code></pre>
<p>a  redirect is:</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-redirectregex
spec:
  redirectRegex:
    regex: &quot;https://example.com&quot;
    replacement: &quot;https://subdomain.example.com&quot;
    permanent: true
</code></pre>
<p>can I have multiple redirectRegex in the same middleware?
I would then just have lots of them to redirect each url</p>

Henry
<p>Just one redirect per middleware, but you can have as many middleware as you want.</p>
<p>But in this case you can use the regex:</p>
<pre><code>  redirectRegex:
    regex: &quot;https://example.com/(blog-1|blog-2|whatever)&quot;
    replacement: &quot;https://subdomain.example.com/$1&quot;
</code></pre>
