Skip to content

Instantly share code, notes, and snippets.

@tonydieu
Created October 10, 2015 17:16
Show Gist options
  • Save tonydieu/3dc79b4bb872e98270b9 to your computer and use it in GitHub Desktop.
Save tonydieu/3dc79b4bb872e98270b9 to your computer and use it in GitHub Desktop.
WP - load files from production server when working locally
<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