Fancy URL’s with Laconica - updated!

After installing Laconi.ca on WoWtweet.net I googled for how to do the fancy URL’s properly in Lighttpd - which turned up a great article about setup / lighttpd by Leslie Orchard - however its a little out of date with regard to the fancy bits…I guess the developers have been busy!

Anyway - I’ve rewritten the lighttpd config using the sample htaccess that comes with the project, borrowed a few bits from Leslie’s post - we now have an up to date version.

$HTTP["host"] == "wowtweet.net" {
    server.name = "WoWTweet"
    server.document-root = "/home/wowtweet/public_html/"

	url.rewrite-final += (
	"^/index.php(.*)$" => "$0",

	"^/$" => "/index.php?action=public",
	"^/rss$" => "/index.php?action=publicrss",
	"^/xrds$" => "/index.php?action=publicxrds",
	"^/featuredrss$" => "/index.php?action=featuredrss",
	"^/favoritedrss$" => "/index.php?action=favoritedrss",
	"^/opensearch/people$" => "/index.php?action=opensearch&type=people",
	"^/opensearch/notice$" => "/index.php?action=opensearch&type=notice",

	"^/doc/about$" => "/index.php?action=doc&title=about",
	"^/doc/contact$" => "/index.php?action=doc&title=contact",
	"^/doc/faq$" => "/index.php?action=doc&title=faq",
	"^/doc/help$" => "/index.php?action=doc&title=help",
	"^/doc/im$" => "/index.php?action=doc&title=im",
	"^/doc/openid$" => "/index.php?action=doc&title=openid",
	"^/doc/openmublog$" => "/index.php?action=doc&title=openmublog",
	"^/doc/privacy$" => "/index.php?action=doc&title=privacy",
	"^/doc/source$" => "/index.php?action=doc&title=source",

	"^/main/login$" => "/index.php?action=login",
	"^/main/logout$" => "/index.php?action=logout",
	"^/main/register/(.*)$" => "/index.php?action=register&code=$1",
	"^/main/register$" => "/index.php?action=register",
	"^/main/openid$" => "/index.php?action=openidlogin",
	"^/main/remote$" => "/index.php?action=remotesubscribe",

	"^/main/subscribe$" => "/index.php?action=subscribe",
	"^/main/unsubscribe$" => "/index.php?action=unsubscribe",
	"^/main/confirmaddress$" => "/index.php?action=confirmaddress",
	"^/main/confirmaddress/(.*)$" => "/index.php?action=confirmaddress&code=$1",
	"^/main/recoverpassword$" => "/index.php?action=recoverpassword",
	"^/main/recoverpassword/(.*)$" => "/index.php?action=recoverpassword&code=$1",
	"^/main/invite$" => "/index.php?action=invite",

	"^/main/favor$" => "/index.php?action=favor",
	"^/main/disfavor$" => "/index.php?action=disfavor",

	"^/main/sup$" => "/index.php?action=sup",

	"^/main/tagother$" => "/index.php?action=tagother",

	"^/settings/profile$" => "/index.php?action=profilesettings",
	"^/settings/openid$" => "/index.php?action=openidsettings",
	"^/settings/im$" => "/index.php?action=imsettings",
	"^/settings/email$" => "/index.php?action=emailsettings",
	"^/settings/sms$" => "/index.php?action=smssettings",
	"^/settings/twitter$" => "/index.php?action=twittersettings",
	"^/settings/other$" => "/index.php?action=othersettings",

	"^/search/people(?:\?(.*)|$)$" => "/index.php?action=peoplesearch&$1",
	"^/search/notice(?:\?(.*)|$)$" => "/index.php?action=noticesearch&$1",
	"^/search/notice/rss(?:\?(.*)|$)" => "/index.php?action=noticesearchrss&$1",

	"^/notice/new$" => "/index.php?action=newnotice",
	"^/notice/(\d+)$" => "/index.php?action=shownotice&notice=$1",
	"^/notice/delete/((\d+))?$" => "/index.php?action=deletenotice&notice=$2",
	"^/notice/delete$" => "/index.php?action=deletenotice",

	"^/message/new$" => "/index.php?action=newmessage",
	"^/message/(\d+)$" => "/index.php?action=showmessage&message=$1",

	"^/user/(\d+)$" => "/index.php?action=userbyid&id=$1",

	"^/tags/?$" => "/index.php?action=tag",
	"^/tag/([a-zA-Z0-9]+)/rss$" => "/index.php?action=tagrss&tag=$1",
	"^/tag(/(.*))?$" => "/index.php?action=tag&tag=$2",

	"^/peopletag/([a-zA-Z0-9]+)$" => "/index.php?action=peopletag&tag=$1",

	"^/featured/?$" => "/index.php?action=featured",
	"^/favorited/?$" => "/index.php?action=favorited",

	"^/(\w+)/subscriptions$" => "/index.php?action=subscriptions&nickname=$1",
	"^/(\w+)/subscriptions/([a-zA-Z0-9]+)$" => "/index.php?action=subscriptions&nickname=$1&tag=$2",
	"^/(\w+)/subscribers/([a-zA-Z0-9]+)$" => "/index.php?action=subscribers&nickname=$1&tag=$2",
	"^/(\w+)/subscribers$" => "/index.php?action=subscribers&nickname=$1",
	"^/(\w+)/nudge$" => "/index.php?action=nudge&nickname=$1",
	"^/(\w+)/xrds$" => "/index.php?action=xrds&nickname=$1",
	"^/(\w+)/rss$" => "/index.php?action=userrss&nickname=$1",
	"^/(\w+)/all$" => "/index.php?action=all&nickname=$1",
	"^/(\w+)/all/rss$" => "/index.php?action=allrss&nickname=$1",
	"^/(\w+)/foaf$" => "/index.php?action=foaf&nickname=$1",
	"^/(\w+)/replies$" => "/index.php?action=replies&nickname=$1",
	"^/(\w+)/replies/rss$" => "/index.php?action=repliesrss&nickname=$1",
	"^/(\w+)/avatar/(original|96|48|24)$" => "/index.php?action=avatarbynickname&nickname=$1&size=$2",
	"^/(\w+)/favorites$" => "/index.php?action=showfavorites&nickname=$1",
	"^/(\w+)/favorites/rss$" => "/index.php?action=favoritesrss&nickname=$1",
	"^/(\w+)/inbox$" => "/index.php?action=inbox&nickname=$1",
	"^/(\w+)/outbox$" => "/index.php?action=outbox&nickname=$1",
	"^/(\w+)/microsummary$" => "/index.php?action=microsummary&nickname=$1",

	"^/(\w+)$" => "/index.php?action=showstream&nickname=$1",

	# Twitter-compatible API rewrites
	# XXX: Surely these can be refactored a little -- Zach
	"^/api/statuses/public_timeline(.*)$" => "/index.php?action=api&apiaction=statuses&method=public_timeline$1",
	"^/api/statuses/friends_timeline(.*)$" => "/index.php?action=api&apiaction=statuses&method=friends_timeline$1",
	"^/api/statuses/user_timeline/(.*)$" => "/index.php?action=api&apiaction=statuses&method=user_timeline&argument=$1",
	"^/api/statuses/user_timeline(.*)$" => "/index.php?action=api&apiaction=statuses&method=user_timeline$1",
	"^/api/statuses/show/(.*)$" => "/index.php?action=api&apiaction=statuses&method=show&argument=$1",
	"^/api/statuses/update(.*)$" => "/index.php?action=api&apiaction=statuses&method=update$1",
	"^/api/statuses/replies(.*)$" => "/index.php?action=api&apiaction=statuses&method=replies&argument=$1",
	"^/api/statuses/destroy/(.*)$" => "/index.php?action=api&apiaction=statuses&method=destroy&argument=$1",
	"^/api/statuses/friends/(.*)$" => "/index.php?action=api&apiaction=statuses&method=friends&argument=$1",
	"^/api/statuses/friends(.*)$" => "/index.php?action=api&apiaction=statuses&method=friends$1",
	"^/api/statuses/followers/(.*)$" => "/index.php?action=api&apiaction=statuses&method=followers&argument=$1",
	"^/api/statuses/followers(.*)$" => "/index.php?action=api&apiaction=statuses&method=followers$1",
	"^/api/statuses/featured(.*)$" => "/index.php?action=api&apiaction=statuses&method=featured$1",
	"^/api/users/show/(.*)$" => "/index.php?action=api&apiaction=users&method=show&argument=$1",
	"^/api/users/show(.*)$" => "/index.php?action=api&apiaction=users&method=show$1",
	"^/api/direct_messages/sent(.*)$" => "/index.php?action=api&apiaction=direct_messages&method=sent$1",
	"^/api/direct_messages/destroy/(.*)$" => "/index.php?action=api&apiaction=direct_messages&method=destroy&argument=$1",
	"^/api/direct_messages/new(.*)$" => "/index.php?action=api&apiaction=direct_messages&method=create$1",
	"^/api/direct_messages(.*)$" => "/index.php?action=api&apiaction=direct_messages&method=direct_messages$1",
	"^/api/friendships/create/(.*)$" => "/index.php?action=api&apiaction=friendships&method=create&argument=$1",
	"^/api/friendships/destroy/(.*)$" => "/index.php?action=api&apiaction=friendships&method=destroy&argument=$1",
	"^/api/friendships/exists(.*)$" => "/index.php?action=api&apiaction=friendships&method=exists$1",
	"^/api/account/verify_credentials(.*)$" => "/index.php?action=api&apiaction=account&method=verify_credentials$1",
	"^/api/account/end_session$" => "/index.php?action=api&apiaction=account&method=end_session$1",
	"^/api/account/update_location(.*)$" => "/index.php?action=api&apiaction=account&method=update_location$1",
	"^/api/account/update_delivery_device(.*)$" => "/index.php?action=api&apiaction=account&method=update_delivery_device$1",
	"^/api/account/rate_limit_status(.*)$" => "/index.php?action=api&apiaction=account&method=rate_limit_status$1",
	"^/api/favorites/create/(.*)$" => "/index.php?action=api&apiaction=favorites&method=create&argument=$1",
	"^/api/favorites/destroy/(.*)$" => "/index.php?action=api&apiaction=favorites&method=destroy&argument=$1",
	"^/api/favorites/(.*)$" => "/index.php?action=api&apiaction=favorites&method=favorites&argument=$1",
	"^/api/favorites(.*)$" => "/index.php?action=api&apiaction=favorites&method=favorites$1",
	"^/api/notifications/follow/(.*)$" => "/index.php?action=api&apiaction=notifications&method=follow&argument=$1",
	"^/api/notifications/leave/(.*)$" => "/index.php?action=api&apiaction=notifications&method=leave&argument=$1",
	"^/api/blocks/create/(.*)$" => "/index.php?action=api&apiaction=blocks&method=create&argument=$1",
	"^/api/blocks/destroy/(.*)$" => "/index.php?action=api&apiaction=blocks&method=destroy&argument=$1",
	"^/api/help/(.*)$" => "/index.php?action=api&apiaction=help&method=$1"
	)
}

About this entry