Skip to content

Instantly share code, notes, and snippets.

@cr0ybot
Created September 6, 2019 19:00
Show Gist options
  • Save cr0ybot/4a53ec02d9b7bf5c4afcf8f70d9d85b2 to your computer and use it in GitHub Desktop.
Save cr0ybot/4a53ec02d9b7bf5c4afcf8f70d9d85b2 to your computer and use it in GitHub Desktop.
WP local dev fetch images from staging
# Load uploads from staging server if they don't exist locally
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^example\.local$
RewriteRule ^wp-content/uploads/(.*)$ https://example.staging.com/wp-content/uploads/$1 [NC,L]
</IfModule>
# BEGIN WordPress
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment