title: rewrite rule to remove a folder from a path and keep rest of directory structure
body: <p>In my base directory I have a lot of folders. I would like to put these folders into a sub-directory.</p>
  
  <p>domain.com/test/test.html</p>
  
  <p>would have the file structure:</p>
  
  <p>domain.com/subdir/test/test.html</p>
  
  <p>and still be at the same url: domain.com/test/</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
  RewriteCond %{REQUEST_URI} !^/subdir/
  RewriteRule ^(.*)$ /subdir/$1 [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  </code></pre>
  
  <p>Copied from another answer here does that but it also stops other requests to the base directory.</p>
  
  <p>I need it to check for foldername matches in the subdir and if it exists or if not serve from base directory.  </p>