I’ve seen many ways to solve wordpress url rewriting for lighttpd. Some people say all you need a server.error-handler-404 = “/index.php” and you’re done, but that didn’t work for me. If you’re trying to run several sites using multiple domain names with multiple installation directories, here’s how I got it to work. But take this with a grain of salt because your mileage may vary. /cliches
First make sure you include the broken-scriptfilename line in your fastcgi line. That was key to getting skins working for me.
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"broken-scriptfilename" => "enable"
)
)
)
Include this once in /etc/lighttpd.conf
server.error-handler-404 = "/index.php"
Include this section once for each installation of wordpress you want to run.
$HTTP["host"] =~ "blog.rootninja.com" {
server.document-root = "/var/www/lighttpd/wordpress1/"
var.wpdir = "/var/www/lighttpd/wordpress1"
}
Include this section just once, and make it last, or at least put it after all the sections above.
url.rewrite-once = (
"^" + wpdir + "(wp-.+).*/?" => "$0",
"^" + wpdir + "/(.*.php)" => "$0",
"^" + wpdir + "/(sitemap.xml)" => "$0",
"^" + wpdir + "/(.*)$" => "/index.php/$1",
"^" + wpdir + "keyword/([A-Za-z_0-9-])/?$" => wpdir + "index.php?keyword=$1"
)