WordPress 3.0 network lighttpd rewrite rules

Tagged lighttpd Tagged WordPress

I recently installed my first WordPress network on lighttpd and was looking for rewrite rules. This post is correct except for the rewrite rule for files. I supposed it’s a change that was introduced in 3.0, or maybe earlier. Anyway, here are updated rewrite rules:

In your lighttpd.conf:

$HTTP["host"] =~ "domain\.com" {
    simple-vhost.default-host = "domain.com"
    include "wpmu-rewrite.conf"
}

And wpmu-rewrite.conf:

url.rewrite-once = (
    "^/(.*/)?files/$" => "/index.php",
    "^/(.*/)?files/(.*)" => "/wp-includes/ms-files.php?file=$2",
    "^(/wp-admin/.*)" => "$1",
    "^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
    "^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",
)

What’s changed from the other site’s example is the ms-files.php rewrite rule.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Redirecting all subdomains to the main domain
  2. WPMU fast backend switch
  3. Snow, Balloons And More

2 Comments

  • Posted by Cliff M on 31. August 2010 at 19:17.

    Can you provide the rewrite code for wp mu installs in a subdirectory?

    For example, my wp multisite install is in the following subdirectory
    htttp://www.mysite.com/myblogs/

    with subsequent new sites being created as “myhome” with the url being http://www.mysite.com/myblogs/myhome

    Thank you.

    • Posted by nicolas on 1. September 2010 at 09:13.

      Hi Cliff, I don’t use subdirectory installs myself, so I don’t really know. Just look for pre-3.0 rewrite rules and fix the ms-files.php line. Should be really easy.

Leave a Reply

Your email is never shared. Required fields are marked *

*
*