Reblogging the past

Thanks to the beauty of the Internet Archive I was able to find copies of all my old posts. An earlier version of this site was powered by a Wordpress install and apparently I didn’t make backups of the database. It’s quite sad losing content, some of it was quite good and it’s left lots of dead links.

I’m now using Tumblr to power the blog part of my site. It allows you to post an entry with _any_ date, which means I can reenter all my old content with it’s original date. An archived version of my site gave me access to all my old blog posts and I’ve now added to Tumblr with it’s original publishing date.

The old Wordpress URL scheme is /archive/*slug*/YYYY/MM/DD/, vs current blog URLs being /blog/*slug*. To keep the old links working I’ve added a htaccess rule to 301 permanent redirect those old URLs to the new using mod_rewrite

RewriteEngine On
    
    # Special cases where the slug has changed
    RewriteRule ^archive/sxsw-day-1-in-an-aeroplane-over-the-sea/{0,1}.*$ /blog/sxsw-day-1 [R=permanent,L,NC] 
    RewriteRule ^archive/post-dconstruct-a-review/{0,1}.*$ /blog/dconstruct-2006 [R=permanent,L,NC] 
    RewriteRule ^archive/28/{0,1}.*$ /blog/xfn-icons-css [R=permanent,L,NC] 
    
    # Default case, redirect with slug
    RewriteRule ^archive?/(.[^/.]*)/{0,1}.*$ /blog/$1 [R=permanent,L,NC]

The more I use mod_rewrite the less it confuses me. The 3 special cases here are for articles where I changed the slug (because it was overly long, or just bad) and the rest is handled by the bottom, more generic, redirect rule. They also silently drop any extra information from the Wordpress URL. So it will work with or without the date info that follows the slug.

Resurrected posts