You are currently browsing the archives for the Lighttpd category


Lighttpd redirects when moving a site to a new domain

This site is hosted on a virtual private server using the Lighttpd web server, which is a bit quicker than the more common Apache web server and as such better suited for the more constrained VPS.

The only time that it’s a problem is when I need to translate Apache mod_rewrite rules into Lighttpd’s rewrite rule format. Usually I can find what I’m looking for online. But sometimes, I’ll roll up my sleeves and figure it out myself.

Here’s a simple one I did this morning. I recently moved this blog from dammerud.us to ekmitchell.com. I’m still getting traffic at dammerud.us, so I put in a redirect to send that traffic over here. This is all it took:

$HTTP["host"] =~ "^dammerud\.us" {
     url.redirect = ( "^/(.*)" => "http://ekmitchell.com/$1" )
}

Pretty basic, I know. Maybe someone will find it useful, though.