Short URLs

For ages I’ve been meaning to create my own link shortener, a bit like tinyurl or bit.ly, which allow you to map a long URL to a nice short one.  The concept is dead easy.  What’s been hard up until now is finding a reasonably priced domain name that is really short.

Luckily .cc domains are now available, which apparently belongs to the Cocos Islands in Australia.  So I bought rjp.cc (my initials) and stuck my link think on there.   I’m quite pleased – the single small script makes notable use of:

  • mod_rewrite rules for avoiding ugly “?” GET variables
  • header relocation
  • MYSQL prepared statements
  • PHP and Javascript in an award-winning combination
  • Conversion to and from base-62.  It should get to nearly a quarter of a million links submitted before the entire returned URL string is more than 10 characters long.