We've relaunched this website using the
Serendipity weblog engine, which is really nice, but one thing that's really been bugging me is the way Serendipity builds permalinks to entries on the site.
Serendipity's default permalinks look something like
/archives/123-Title-of-Post.html. Now I don't like the "archives" bit or the numeric ID, and I want the post title to be always in lower case (and preferably be a separate field from the title so I can clean it up a bit in some cases) and I don't want to see ".html" tacked on the end. Permalinks are important, they're intended to be permanent and hopefully survive across relaunches, so it's worth a bit of effort to get them right in the first place.
I realise that sticking the ID in the link helps a bit with efficiency – it's quicker to pull something out of the database given it's ID – but frankly I'm prepared to work those Xeons in VPSLink's server farm just that bit harder in order to get good looking links.
So far I've managed to make the permalinks look more like
/2007/07/12/title-of-post which I'm pretty happy with, but I haven't yet looked at how much it would be to add a separate "url-title" field separate from the post title.
Changing the format of link is really easy in Serendipity's configuration, but there didn't seem to be any way to force the permalinks to be lower-case (maybe there's a plugin for this but I couldn't find one). Fortunately Serendipity is pretty well put together and there's a single function for generating permalinks called
serendipity_archiveURL in
include/functions_permalinks_inc.php. Change the last line of that function to be
return strtolower($path);
and everything Just Works. If you've already created some entries and you'd like to lowercase the existing permalinks, they can be easily updated in the
serendipity_permalinks table in the database. If your site is already live then it'd be a good idea to keep the current capitalized links and add new rows to that table with the text in lower case, so you don't break any existing inward links to your site from other places.