bradford bio photo

Twitter LinkedIn Github Stackoverflow

My blog’s old domain are set to expire in November. The reason I initially registered the domain was to create a family website. My family traditionally has communicated by mass email and reply-all conversations and I thought it would help to give them something different. They rarely used it however so I decided to simply focus on my own blog. Since I have several articles that get regular hits from search engines, I worried that my articles wouldn’t be very visible. I decided to try writing up some redirect rules for my old domain in the lighttpd config file so that anyone going to my old blog links would be redirected to their new addresses.

I came up with the following rules:

$HTTP["host"] !~ "^(bradford).($" {
    $HTTP["host"] =~ "^(.+.)?($" {
    url.redirect = ("(.*)" => "")
    url.redirect-code = 301

$HTTP["host"] =~ "" {
    url.redirect = (
    "^/(.*)$" => "$1" )
    url.redirect-code = 301

The first group handles any request to a subdomain of the old website EXCEPT and redirects them to with a redirect code of 301.

The second group handles any request to and redirects them to WITH the trailing address. This works wonderfully as long as you don’t change the structure of your permalinks.

Remember to enable mod_redirect under server.modules in your lightty configuration file.