Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock production uploads for parity purposes #83

Open
malarstrom opened this issue Mar 1, 2019 · 0 comments
Open

Mock production uploads for parity purposes #83

malarstrom opened this issue Mar 1, 2019 · 0 comments

Comments

@malarstrom
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant