Skip to content

Instantly share code, notes, and snippets.

@chuckreynolds
Created July 1, 2016 22:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckreynolds/664e6ae0d0ed2b38639c969312fa7202 to your computer and use it in GitHub Desktop.
Save chuckreynolds/664e6ae0d0ed2b38639c969312fa7202 to your computer and use it in GitHub Desktop.
Local WordPress Media Uploads Fallback. Substitute {PROD} for the domain to use images from.
<IfModule mod_rewrite.c>
RewriteEngine on
# Attempt to load files from production if
# they're not in our local version
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule wp-content/uploads/(.*) \
http://{PROD}/wp-content/uploads/$1 [NC,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment