Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load media files from production server if they don't exist locally - htaccess tweak
# Load media files from production server if they don't exist locally
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://<insert-production-sitedomain>/$1 [QSA,L]
</IfModule>
# Sep 2018 - Simplified using css-tricks.com recommendation
# Feb 2018 - verified working on local by flywheel
@CapWebSolutions

This comment has been minimized.

Copy link
Owner Author

CapWebSolutions commented Sep 21, 2018

Add these lines to the start of your WordPress Local by Flywheel .htaccess (for apache based server configs).
This will pull in any uploads resources from the live / production site.
This eliminates the need to download all that stuff locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.