Skip to content

Instantly share code, notes, and snippets.

@lfbittencourt
Created April 5, 2018 18:58
Show Gist options
  • Save lfbittencourt/6aaca58a760d71c324459a93f886bed5 to your computer and use it in GitHub Desktop.
Save lfbittencourt/6aaca58a760d71c324459a93f886bed5 to your computer and use it in GitHub Desktop.
Loads production assets in case files don't exist locally
<IfModule mod_rewrite.c>
RewriteEngine On
# Try production domain if file doesnt exists
RewriteCond %{HTTP_HOST} !^foo\.com [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^uploads/.*$ http://foo.com/$0 [L,NC]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment