Skip to content

Instantly share code, notes, and snippets.

@lfbittencourt
Created April 5, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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