August 10, 2003 · Dan Cederholm

Permalink Progress

After reading the helpful entry Redirection Complete over at Stopdesign, I decided to try and help my old permalinks find their way to at least the correct monthly archive page.

Reading up a little on regular expressions helped me write this solution to my .htaccess file:

RewriteEngine	on
RewriteBase	/
RewriteRule	^2003([0-9][0-9])	archives/2003/$1/	[R]

There's a similar RewriteRule for each year of archives. So now any old-style permalink pointing to something like /YYYYMM#123456789 will redirect to /archives/YYYY/MM/ which is that month's archive. Not perfect yet, but at least a heck of a lot better.

There are also some additional links to helpful MT link conversion methods in the comments to the previous post -- for those having to deal with the same scenario.