title: Conditional URL rewrite
body: <p>I need the URL <code>example.com/app</code> to show the content from <code>example.com/app/dist</code></p>
  
  <p>The following code does exactly this.</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^$ /app/dist/ [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !^/dist/
  RewriteRule ^(.*)$ /app/dist/$1
  </code></pre>
  
  <p>BUT I also need the URL <code>example.com/staging</code> to show the content from <code>example.com/staging/dist</code></p>
  
  <p>With the current setup, the url <code>example.com/staging</code> is showing the content from <code>example.com/app/dist</code></p>
  
  <p>The .htaccess while is located in the <code>/app</code> and <code>/staging</code> folder (but it has to be the same file)</p>