joren-rapini
10/3/2019 - 7:00 PM

Use production images/assets, only if they're missing on local

<IfModule mod_rewrite.c>
RewriteEngine On

# Load local files if they exist
RewriteCond %{REQUEST_URI} ^/wp-content/([^\/]*)/((.*))$
RewriteCond %{DOCUMENT_ROOT}/wp-content/%1/%2 -f
RewriteRule ^(.*)$ $1 [QSA,L]

# If they don't exist, load the file from production
RewriteCond %{REQUEST_URI} ^/wp-content/([^\/]*)/.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://survive-a-storm.com/$1 [QSA,L]
</IfModule>