title: Rewrite rule for trying 2 locations
body: <p>I have 2 WordPress websites on the same VPS. One <code>/var/www/live/</code> and one <code>/var/www/dev/</code>. I want the following rule for <code>wp-content/uploads</code> on dev: if file exists on dev, show this file, if not, get file thru web from live. My .htacces:</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
  
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
  
      RewriteRule ^wp-content/uploads/(.*)$ https://live.site/wp-content/uploads/$1 [L]
      RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <p>I don't understand, how to combine 2 last rules, because first rule breaks second. If I comment first rule, WordPress working correctly.</p>