The MU forums have moved to

map folders to servers (2 posts)

  1. bigdoug
    Posted 16 years ago #

    This may be more of an apache/.htaccess question...but:

    I have a couple users on my setup who have a ton of readers. They use a bunch of images and I'm afraid their success might impact the ability of my bandwidth to meet the needs of the less popular bloggers.

    So here's the question: Can I, with WPMU, map certain folders of blogs.dir to another, lower-end server that just serves images and podcasts (e.g. for user number 42)?

    Thanks in advance!

  2. beaulebens
    Posted 16 years ago #

    bigdoug - from what I can see/know of mu, files in blogs.dir aren't directly accessed through URLs, they are always controlled via an existing RewriteRule which is created in the .htaccess file during installation.

    You'd want to change this line:

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    and probably add in some RewriteCond (conditions) to check the host name (assuming you're using subdomain, rather than path hosting), then when certain conditions (hostnames) are matched, you use a different RewriteRule something like:

    RewriteRule ^(.*/)?files/(.*)$2 [L]

    Of course you'd also need to make sure that everything was replicated over to this server as well so that images users upload are immediately available.

    To make this really powerful, you might want to look at the "RewriteMap" directive for Apache, and consider setting up a mapping of subdomain -> blog_id so that you can use that to find the right directory on your media server, then you could avoid DB access altogether on it perhaps.



About this Topic

  • Started 16 years ago by bigdoug
  • Latest reply from beaulebens