Situation
I have a Wordpress Multisite installation run through GIT which has the latest commit on every environment:
- Local
- Development
- Production
In the wp-config.php
I do rewrite on core filesystem like wp-content, uploads and plugin and theme folder as followed:
define( 'BLOGUPLOADDIR', $_SERVER['DOCUMENT_ROOT'] . '/media' );
define( 'UPLOADS', 'media');
Problem
Currently subsites are not using this route to process the media upload through that structure. On the local environment it works perfect, and file structure goes to /media/sites/{blog.id}/{files}
. On production and development this is not working and files are uploaded to /wp-content/blogs.dir/{blog.id}/
.
The files are exactly the same and also the settings per site are exactly the same. I've looked also in the database for each site and saw that local, dev and prod use exactly the same options.
I've tried to look at the workflow of media upload and figured out that the follow functions are used by defining file structure of media upload:
https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/ms-default-constants.php#L0
Looking further I see in the following function an alternative setting is doing a rewrite.
Desired answer
I want to know what is triggering the behavior of the rewrite on my local machine, so I can create a solution to run this on every environment by default.