Different directory names between site and S3 bucket #417
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My use case
I already have an S3 bucket containing all the Wordpress Multisite's media files but the uploads directory is not called "uploads". The website is also behind an existing CDN so the URL path needs to remain the same which includes that "/uploads/" section of the path but the S3 bucket should not have that. I'm also not using the URL rewrites and configured nginx to reverse proxy to the S3 private bucket by signing the headers in the request.. The only missing bit was that the plugin needed to make this distinction in folder/directory names between the URL and the S3 bucket.
This is my attempt at achieving this goal.
To make this work add the following line to
wp-config.php
define('S3_UPLOADS_DROP_UPLOADS_DIR', true);
Feel free to improve on this - I had to get something up and running quickly.