WordPress 3.0 network lighttpd rewrite rules
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.
Related posts:
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.
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.