wocker icon indicating copy to clipboard operation
wocker copied to clipboard

Mock production uploads for parity purposes

Open malarstrom opened this issue 7 years ago • 0 comments

This isn't obvious to everyone. So here's a tip!

If you'd like to mock the uploads of the production environment of the site you are working on. Then just (so you don't have to use a local copy of the production uploads):

  1. Create ~/data/{CONTAINER}/wp-content/uploads/.htaccess containing (before wp directive):
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule (.*) http://{PRODUCTION_URI}/wp-content/uploads/$1
</IfModule>

All uploads with local file paths will now be served from the production site. If you by any reason have a different structure for the uploads folder, just change it in the rule

Enjoy!

malarstrom avatar Mar 01 '19 13:03 malarstrom