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

Beginnings of multisite support #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

jrfoell
Copy link

@jrfoell jrfoell commented Sep 18, 2013

I started looking at multisite support for this, at first it didn't seem promising b/c ms-files.php doesn't have any hooks available to plugins... Then I found this ticket: http://core.trac.wordpress.org/ticket/19235 and this article: http://halfelf.org/2012/dumping-ms-files/

So if I force my local system to use the new style multisite files by adding to wp-config.php:

define( 'UBP_SITEURL', 'http://example.com' );
define( 'UPLOADBLOGSDIR', 'wp-content/uploads/sites' );

and removing this rule from my .htaccess:
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

I could get uploads by proxy to retrieve the files from the live site and put them in the new wp-content/uploads/sites structure.

I also added a "UBP Site URL" setting to the site settings in wp-admin/network/ -> Sites -> All Sites -> Edit -> Settings Tab (very bottom). This will override the UBP_SITEURL define if present, incase someone wants to have a multisite setup where subsites point to completely unrelated live sites.

I haven't (yet) tested subdomains.

@pdclark
Copy link
Owner

pdclark commented Sep 19, 2013

Wow! This is really awesome to see!!! I'm swamped between WPSessions and WordCamp Los Angeles right now, but I've made a note to read through your code as soon as possible. Thank you for submitting this! I've wanted to see true network support in UBP for a long time!

@jrfoell
Copy link
Author

jrfoell commented Feb 22, 2014

So there's a problem with sub-folder multi-site that happens with the default .htaccess that WP generates. I don't know if it is actually an Apache problem or a WP problem, but you can read more here: https://core.trac.wordpress.org/ticket/20746

I came up with a workaround and added the instructions to the readme. Hopefully smart(er) WP core contributors will come up with a better solution.

With the workaround, it seems to work good on both sub-folder and sub-domain multi-site installs.

My fork should be synced with the latest changes from your master as of 2/22/14.

@jrfoell
Copy link
Author

jrfoell commented Jun 24, 2016

Hi @pdclark, just wanted to check in and see if you could merge this pull request. I'm going to submit another for a non-multisite issue fix, but realized this one was still in waiting :)

@pdclark pdclark mentioned this pull request May 10, 2017
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

Successfully merging this pull request may close these issues.

2 participants