For those of you who might not want to roll your own, I've created a pretty robust plugin called 'la petite url', which is highly configurable. It is available at the following url: http://extrafuture.com/projects/la-petite-url/