Last active
September 21, 2018 19:10
-
-
Save CapWebSolutions/8c91f31bcb92201291676d3697a99087 to your computer and use it in GitHub Desktop.
Load media files from production server if they don't exist locally - htaccess tweak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.