[wp-trac] [WordPress Trac] #23221: Multisite in subdirectory with root site address
WordPress Trac
noreply at wordpress.org
Fri Jan 31 15:29:02 UTC 2014
#23221: Multisite in subdirectory with root site address
----------------------------+------------------------------
Reporter: grapplerulrich | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: 3.5
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses: multisite
----------------------------+------------------------------
Comment (by Denis-de-Bernardy):
For the uploads folder, a mu-plugin and a rewrite rule actually do the
trick, e.g. for /media that would be:
{{{
RewriteRule ^([_0-9a-zA-Z-]+/)?(media/.*) $2 [L]
}}}
{{{
add_filter('pre_option_upload_path', function($val) {
return '../media';
});
add_filter('pre_option_upload_url_path', function($val) {
$media_url = home_url('/media');
$media_url = preg_replace("#^.*?//[^/]+#", '', $media_url);
return $media_url;
});
}}}
Can anyone picture how this could get fixed properly in WP?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23221#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list