-
How to make an URL-shortening service
Posted on June 24th, 2010 1 commentRecently I was a little bit bored. And always when I’m bored I gonna start working on small projects just to drive away boredom. What I did this time was an URL-shortening service. URL-shortening service? What’s that? I’m pretty sure, most of you have used one before. Everybody hates long addresses like http://www.example.com/this/is/a/horrible/long/url.php?id=laksdfjlkfadjoweiu – they are extremely uncomfortable, especially when you want to copy them into an email or share it on a service like Twitter. So URL-shortening services like tinyurl.com come in handy, as they shorten an address like above to something like http://tinyurl.com/AB734 (this is just an example).
These services use special algorithms to shorten URLs. Although I was using this service regularly, I was never paying attention to how it is achieved. Until yesterday. As I already mentioned I was bored. And suddenly it struck me – why not build an URL-shortening service? This can’t be so difficult, I thought. So I started to google a little bit and then started to code. And to be honest, it was not that difficult. In this blogpost I gonna show you how I wrote my URL-shortener.


