Skip to content

Instantly share code, notes, and snippets.

@ianpegg
Last active September 17, 2021 12:10
Show Gist options
  • Save ianpegg/0fd4906e65f8a8d0355d44b5c07d294b to your computer and use it in GitHub Desktop.
Save ianpegg/0fd4906e65f8a8d0355d44b5c07d294b to your computer and use it in GitHub Desktop.
Fetch 'uploads' files from LIVE if not found on DEV
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions Inherit
# If the requested URL doesn't match a directory or file...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite the request to be fetched from LIVE instead
RewriteRule wp-content/uploads/(.*)
## Be sure to replace 'example.com' with the domain name of LIVE ##
https://www.example.com/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