The MU forums have moved to WordPress.org

having wpmu handle only a subdirectory (suburl?) of a site (5 posts)

  1. shaver
    Member
    Posted 17 years ago #

    Hello, wpmuers!

    I'm looking to migrate a bunch of existing WP blogs to a single shiny WPMU install, and haven't been able to figure out how to make one part work: having wpmu handle only a portion of a domain's web space.

    Specifically, I want to have http://shaver-new.off.net/diary/ be a wpmu blog, but http://shaver-new.off.net/everythingelse just be handled normally. I tried

    Alias /diary/ /var/www/html/wpmu/

    which worked for the main page and the wp-admin interface just fine, but failed when trying to access archives and permalinks like http://shaver-new.off.net/diary/2007/06/. The error message is:

    [Sat Jun 30 07:08:33 2007] [error] [client 74.98.176.15] script '/var/www/sites/shaver.off.net/html/index.php' not found or unable to stat, referer: http://shaver-new.off.net/diary/

    I suspect the problem is that wpmu doesn't expect to be Aliased in, and therefore its RewriteBase is (reasonably!) not coping with being a subdirectory, but I'm not sure how else to go about this.

    Anyone done this before? Am I just out of luck? Any advice, or even cautionary tales of woe, would be greatly appreciated.

    Mike

  2. lunabyte
    Member
    Posted 17 years ago #

    Just make the directory, and put it there.

    Be advised that MU doesn't like being in a subdirectory though.

  3. shaver
    Member
    Posted 17 years ago #

    Hmm, I think I didn't make myself clear, sorry. I have a WPMU installation that I can point (via Multi-Site-Manager) various domains and blogs at. I can make foo.com/blog1 and foo.com/blog2 be WPMU blogs, but I can't make WPMU only "own" a subdirectory of an existing domain -- it wants the whole domain to be pointed at WPMU, as I think you're alluding to.

    I'll keep fiddling with the rewrite rules to see if I can figure something out, though.

  4. drmike
    Member
    Posted 17 years ago #

    *chuckle* That's why it's recommended that you do subdomains and not subdirectories. Preexisting subdirectories work fine without issue when wpmu is ran with subdomains.

    http://daria.be/forums

    I *THINK this should work in thte htaccess file:

    RewriteCond %{HTTP_HOST} foo.com/subdirectory
    RewriteCond %{REQUEST_URI} !/subdirectory
    RewriteRule ^(.*)$ /subdirectory/$1 [L]

    I hate doing rewrite rules.

  5. shaver
    Member
    Posted 17 years ago #

    I'm not sure what you mean by "is ran with subdomains" -- I have multiple disjoint domains (not subdomains of a common root) working with WPMU, but I have a number of existing WP installations that I want to convert over to being WPMU instances. They range from being their own domains (blog.domain1.com) to just a directory into which someone unpacked a WP instance (user.server.com/myblog), and I'm trying to find a workable way to make the latter case work, without having to point all of user.server.com at the WPMU installation. I tried Aliasing /myblog to /var/www/html/wpmu to get wpmu invoked for requests to that path, but the htaccess in the WPMU install dir really doesn't expect to be invoked like that, and I'm not really sure how to rewrite my way to victory. I have something to experiment with later today, though, so if that works (or even permutes the problem interestingly!) I'll report back.

    Thanks again.

About this Topic