Skip to content

Mock production uploads for parity purposes #83

@malarstrom

Description

@malarstrom

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions