Make Your Own URL Shortening Service – url shorteners – Lifehacker. Must read this and implement.