Rewrite for lighthttpd with WordPress
Emil Haukeland wrote a very nice guide on how to configure rewrite so it works with lighthttpd and WordPress. To quickly sum it up add the following rules to your lighthttpd.conf or 10-rewrite.conf and save it in lighthttpd’s configuration folder.
$HTTP["host"] =~ "ostebaronen.dk" {
url.rewrite-final = (
# Exclude some directories from rewriting
"^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0",
# Exclude .php files at root from rewriting
"^/(.*.php)" => "$0",
# Handle permalinks and feeds
"^/(.*)$" => "/index.php/$1"
)
}
Then edit the settings for permalinks in WordPress.
Many thanks to Emil Haukeland, find the his original blog post on his personal blog: emil.haukeland.name