title: How do I redirect a URL's directory and subdirectories paths in Vercel?
body: <p>I want URLS to be redirected like this:</p>
  <blockquote>
  <p><code>https://example.com/a/file.txt</code> to <code>https://example.com/aFolder/a/file.txt</code><br />
  <code>https://example.com/a/b/file.txt</code> to <code>https://example.com/aFolder/a/b/file.txt</code><br />
  <code>https://example.com/a/b/c/file.txt</code> to <code>https://example.com/aFolder/a/b/c/file.txt</code><br />
  and so on...</p>
  </blockquote>
  <p>I am currently using this:</p>
  <pre><code>{
    &quot;source&quot;: &quot;/:path/:filename.:ext&quot;,
    &quot;destination&quot;: &quot;/aFolder/:path/:filename.:ext&quot;
  },
  {
    &quot;source&quot;: &quot;/:path/:subpath1/:filename.:ext&quot;,
    &quot;destination&quot;: &quot;/aFolder/:path/:subpath1/:filename.:ext&quot;
  },
  {
    &quot;source&quot;: &quot;/:path/:subpath1/:subpath2/:filename.:ext&quot;,
    &quot;destination&quot;: &quot;/aFolder/:path/:subpath1/:subpath2/:filename.:ext&quot;
  }
  </code></pre>
  <p>This works for upto 3 sub directories. Is there any other method to eliminate the restriction? I'd prefer something like this:</p>
  <pre><code>{
      &quot;source&quot;: &quot;/:pathWithOrWithoutSlashes/:filename.:ext&quot;,
      &quot;destination&quot;: &quot;/aFolder/:pathWithOrWithoutSlashes/:filename.:ext&quot;
  }
  </code></pre>