The MU forums have moved to WordPress.org

WPMU in root, subsequent blogs in subdomain (14 posts)

  1. r-a-y
    Member
    Posted 12 years ago #

    Not sure if this is possible, but thought I'd ask.

    I currently have WPMU installed in the root and was wondering for all new blogs (every blog except blog_id #1), can they be run under a subdomain?

    To be clear, I have WPMU installed in:
    hxxp://www.example.com (blog_id #1 should be shown here)

    I want all subsequent blogs to be created from
    hxxp://blogs.example.com

    So that new blogs will have a subdirectory under that subdomain.
    eg. hxxp://blogs.example.com/newuserblog/

    ---

    Any advice would be appreciated! Right now, I have WPMU setup to run new blogs under subdirectories (eg. hxxp://www.example.com/newuserblog/), but I'd really prefer the method I have written above going forward.

    Thanks for reading.

  2. STDestiny
    Member
    Posted 12 years ago #

    You could probably install wpmu into the subdomain and then just put an index.php into your root that redirects to blogs.example.com Or you could try adding a mod_rewrite to your root.

  3. r-a-y
    Member
    Posted 12 years ago #

    Thanks for the reply, STDestiny.

    If I were to go with the latter (mod_rewrite in the root), what rewrite rules would work?

    Also would this create cookie problems since we have bbPress integrated with WPMU as well.

  4. Ovidiu
    Member
    Posted 12 years ago #

    @r-a-y:

    wpmu is intended to work exactly like you want it. just install into the root and chose subdirectory install.

    With the sole exception, tha ootb wpmu doesn't work with the WWW and to fix that you have to hack a lot of files :-( so rather accept it.

  5. STDestiny
    Member
    Posted 12 years ago #

    @r-a-y: in that case I'd probably go with the first method. You could use a php file to redirect to blog.example.com

    @ovidiu: The catch is he wants to install wpmu in subdirectories of blogs.domain.com but have the main blog be in domain.com

  6. andrea_r
    Moderator
    Posted 12 years ago #

    In this case, I'd be inclined to install MU in blogs.domain.com using the subdirectory method.

    Then, I'd use a simple php file in the root of my site, call in wp_head, and fill in whatever else I wanted to show on the "main" page.

    I've done it in single WP before (on my personal blog), can't see any reason it wouldn't work.

  7. r-a-y
    Member
    Posted 12 years ago #

    The problem with the first option (installing to blogs.domain.com) is the post data in blog_id #1 has to be in the root... that means all posts and pages need to reside from the root domain.

    andrea_r, your method sounds like only the homepage would be shown in the root; unless I'm completely misunderstanding things!

    The other problem is integration... the WPMU bar, admin login and bbPress... I'm not sure if the setup I want will mess up single sign-on.

    Any additional thoughts?

  8. andrea_r
    Moderator
    Posted 12 years ago #

    "the post data in blog_id #1 has to be in the root... that means all posts and pages need to reside from the root domain."

    Ahh....

    "your method sounds like only the homepage would be shown in the root; unless I'm completely misunderstanding things!"

    Yep.

    Well, what you can do is install a single WP in the root and MU in blog.domain.com. Easiest way to get what you need. With the single sign on, you may be able to dump them both in the same db.

    (man, that makes it hard...)

    Ooo! wait! Install WPMU in the root. Add a multi-site plugin, and instead of using a separate domain for another Site, use blogs.domain.com. :D

    Do-able, yes. See? http://wpmututorials.com/how-to/blog-categories/

  9. r-a-y
    Member
    Posted 12 years ago #

    Hey andrea_r,

    Thanks for the reply.

    That Multi-Site plugin looks promising.

    I'm going to complicate things one more time!

    How would single sign-on work between the root blog and the multi-site blogs, especially with BuddyPress and bbPress installed?

  10. STDestiny
    Member
    Posted 12 years ago #

    as long as the cookies are all set properly it should work fine.

    Good thinking on the multi-site option, andrea! :)

  11. r-a-y
    Member
    Posted 12 years ago #

    Just thought of another thing... what if I want another blog id (let's call this blog id #2) hosted under a subdirectory in the root, while keeping all other blogs on the "blogs" subdomain?

    eg.
    hxxp://www.example.com (blog ID #1 is here, BuddyPress is also installed here)

    hxxp://www.example.com/blognumber2 (blog ID #2 is here)

    All other blogs except blog IDs 1 and 2 as subdirectories, under:
    hxxp://blogs.example.com/

    Is this possible with the multi-site plugin?

    Also, since users will be able to create new blogs will I have to worry about configuring the multi-site plugin each time a new blog is created?

    Sorry if these questions seem redundant!

  12. STDestiny
    Member
    Posted 12 years ago #

    1. yes, that is what the multi-site plugin is designed for

    2. sitewide settings are set on a per site basis, so you can disable signups for example.com while they are still allowed for blogs.example.com

  13. andrea_r
    Moderator
    Posted 12 years ago #

    And just to clarify: Sites in MU (note the capital S) refer to another instance of MU whereby sub-blogs can be created.

  14. r-a-y
    Member
    Posted 12 years ago #

    And just to clarify: Sites in MU (note the capital S) refer to another instance of MU whereby sub-blogs can be created.

    Okay, this might have messed up my plans if I understand that sentence correctly.

    Let's say I have BuddyPress installed in the root instance of MU, would BuddyPress be able to detect member blogs on the new Site instance (eg. the subdomain Site - blogs.example.com? It is kind of imperative that BuddyPress detects these blogs from the subdomain.

    Also say I have blogs already setup with my current subdirectory MU setup (eg. http://www.example.com/eachmemberbloginstance) and I install the Multi-Site plugin, would I be able to "port" over my current member blogs over to the new subdomain Site (eg. blogs.example.com/eachmemberbloginstance, etc.) without much difficulty?

    I think I'll actually cross-post this reply to Ron over at WPMUTutorials.com and see what he has to say.

About this Topic