Switched to lighttpd, fixed previews in edit pane
I’ve made a minor modification to Vaam Yob’s url.rewrite configuration used to make pretty permalinks for WordPress under lighttpd.
His permalinks work great for the end user but I was frustrated to see that the preview pane when editing pages and posts was broken. I managed to fix that by slightly changing his regular expressions. I also added a few excludes with help from Laitsas’s code examples.
I hope I don’t need to muck with my rewrite rules anytime soon. I’ve settled upon this:
url.rewrite = (
"^/(wp-|images)/{0,1}(?!no.css)(.*)" => "$0",
"^/page/([0-9]+)/?$" => "/index.php?paged=$1" ,
"^/date/([0-9]+)/?([0-9]+)/?$" => "/index.php?m=$1$2" ,
"^/date/([0-9]+)/?([0-9]+)/?([0-9]+)/?$" => "/index.php?m=$1$2$3" ,
"^/(.+)/([0-9]+)/[^/]+/?/feed/(feed|rdf|rss|rss2|atom)/?$" => "/index.php?category_name=$1&p=$2&feed=$3",
"^/(.+)/([0-9]+)/[^/]+/?/(feed|rdf|rss|rss2|atom)/?$" => "/index.php?category_name=$1&p=$2&feed=$3",
"^/(.+)/([0-9]+)/[^/]+/?/page/?([0-9]{1,})/?(.*)$" => "/index.php?category_name=$1&p=$2&paged=$3$4" ,
"^/(.+)/([0-9]+)/[^/]+/?([0-9]+)?/?$" => "/index.php?category_name=$1&p=$2&page=$3" ,
"^(.+)/([0-9]+)/[^/]+/?/trackback/?$" => "/index.php?category_name=$1&p=$2&tb=1" ,
"^/feed/(feed|rdf|rss|rss2|atom)/?$" => "/index.php?feed=$1" ,
"^/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$" => "/index.php?category_name=$1&feed=$2" ,
"^/(.+)/(feed|rdf|rss|rss2|atom)/?$" => "/index.php?category_name=$1&feed=$2" ,
"^/category/(.+)/?$" => "/index.php?category_name=$1" ,
"^/([_0-9a-zA-Z-]+)/?(.*)$" => "/index.php?page_id=$1$2" )
Update Jan 24th 2007: Caught an issue with comment rss not working. I left an extra space in there somehow. Also noticed there was a space in /page/ which I removed. Now multipage posts should work too.
Update Feb 5th 2007: Missed a trailing slash that prevented /date/year/month/day/ from working. I didn’t catch this because /date/year/month/day worked, now they both work. No more 404s from ask.com’s robot!






