Skip to content

Instantly share code, notes, and snippets.

@CapWebSolutions
Last active September 21, 2018 19:10
Show Gist options
  • Select an option

  • Save CapWebSolutions/8c91f31bcb92201291676d3697a99087 to your computer and use it in GitHub Desktop.

Select an option

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
# 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
Copy link
Copy Markdown
Author

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