« The Truth | Main | Mod Rewrite Help »

March 30, 2004
Future-Proofing Slapnose

Warning: Geeky Crap Ahead

I was pointed to Justin Blanton's little tip for future-proofing URIs by Simple Bits.

Since I'd recently changed my archiving to individual archives (bet you didn't even notice), it wasn't a big deal to make some more changes, and now I've done it.

The basic gist is that Moveable Type assigns an internal ID to each post, and by default names the individual files, as well as the anchor tags for other types of archives, with this ID. This is a problem because if you change web hosts, for example, or for any other reason have to reimport your entries, these IDs are not preserved and all your links will go bad. Ick.

Justin's technique is to make each entry the index of a directory named with the entry's title. There's some little regex trick in there using a plugin from Brad Choate (that guy has lots of useful thingies) to remove the file name from links, and it all works great. I switched all of my archives -- individual, monthly and category -- to this technique.

(Category archives are still unlinked until I nail down what categories I want to have. It's harder than it sounds. I keep getting too specific.)

All of these changes may actually create some more broken links out there in the short term, but in the long run they should decrease and I won't have to go nuts if/when I reinstall, switch to PHP extensions, or whatever. And to take care of the potential increase in errors, I've upgraded my 404 page to a "smart 404 page" courtesy of A List Apart.

The down side is that if you know you have links to specific posts here, they're surely broken now. I apologize for that, but it had to happen. If I knew how to use mod-rewrite, I'd do something about it. As it is, I'll just ask that you update the links if possible.

What else... Oh, naturally I'm working on another redesign, should be ready pretty soon. It expands and simplifies the ideas from my last one, and hopefully will bring all the pages together. And they say I don't have a job.

Comments

Previous Comments

Nice work! I had some fun with mod_rewrite a while back. Your situation is a bit trickier than mine was, but I think you should be able to fix any links that might have broken after changing your filenames. Unfortunately, you probably need to add a rule for each old page. I have some links to some useful mod_rewrite stuff here: http://www.jpreardon.com/blog/front/archives/000161.php

mod_rewrite is pretty staight forward... you're just to busy being a l33t fps gamer d00d.