Zovirl Industries

Mark Ivey’s weblog

URIs Moving documents

I came across one of the first tests of my new URI format today. I wanted to post an update to the timezone plugin, but I wanted to keep the previous version around. Hmmm…multiple stories on the same topic? That sounds like a job for a category. Sadly, the obvious category for this (/software/blosxom/plugins/timezone) was already taken by my previous version, which was sitting on these URIs:

I’m not using the full date in my URI, so I only get to reuse a path once a year. Fortunately I got lucky because we just entered a new year. That means /2004/software/blosxom/plugins/timezone is available for me to use. Here are the new URIs I laid out:

So, I moved the old files to the new locations, added the new files, and updated my metadates so they were all correct. I then updated my .htaccess to add 301 redirects for the old URIs:

...
Redirect permanent /2003/software/blosxom/plugins/timezone_about \
   http://zovirl.com/2004/software/blosxom/plugins/timezone/
RedirectMatch permanent /2003/software/blosxom/plugins/timezone_about\.(.*) \
   http://zovirl.com/2004/software/blosxom/plugins/timezone/index.$1
Redirect permanent /2003/software/blosxom/plugins/timezone \
   http://zovirl.com/2004/software/blosxom/plugins/timezone/timezone_0_0_2
Redirect permanent /2003/software/blosxom/plugins/timezone_pod.html \
   http://zovirl.com/2004/software/blosxom/plugins/timezone/pod_0_0_2.html
...

Finally I posted the new version. Overall it was a fairly simple task. I got lucky with the new year, in the future I’ll have to be more careful when I post stories I know will turn into categories in the future.

Update: Found one more gotcha: my internal links are generated using the absolute plugin. When I move files, old references to them need to be updated in my blosxom stories, otherwise absolute can’t find the files and doesn’t generate the right links.

Update 2: It really makes more sense to set the directories up like this:

http://zovirl.com/2004/software/blosxom/plugins/fullcategory/v0_0_1/about.blosxom
http://zovirl.com/2004/software/blosxom/plugins/fullcategory/v0_0_1/fullcategory
http://zovirl.com/2004/software/blosxom/plugins/fullcategory/v0_0_2/
...