Blog Pile

Live/Die By Those Short URLs


cc licensed flickr photo shared by Andrew Mason

Ouch, indeed. Once upon a pre-twitter time there was but a few services that offered easy ways to turn long ugly URLs into shorter ones. I might be hard pressed to find someone that has not clicked a TinyURL and I remember at least 5 years ago using notlong.

More than a year ago Mashable listed 90 of them. Now there must be about 194 different ones.

FactoryJoe tracks more than 100 in a flickr set:
shorties

is.gd ow.ly beam.to shrtlink tr.im memurl just.as url.ie curio.us?

In twitter this are fine as we toss links like free potato chips; but what about if you start using them on your web site? What happens if bt.ly bit.es the.dust? (note- I use bit.ly a lot, easy to create custom names…)

I had started using a few bit.ly ones for NMC web sites, but got interested in having our own service, some for some branding, some so I’d have management of the service. I sifted through a few open source ones, but there are a heap (there is a long list tagged in delicious). I started using phurl, a set of PHP/MySQL scripts.

It was pretty basic, though I ended up cleaning up the web forms, and creating a password on top so only our staff could use to create URLs. Also, this one was hardwired to 6 character strings, and although I could edit them in the database, it was not really as custom a naming as we would like.

It worked okay for a few weeks, but after a rash of server outages, I found the script was overloading on MySQL connection requests. I did not really dive into the code to find out why, I just pulled the plug.

This would seem to be a problem if you want to run your own re-direction scripts, especially if it hits your database. Whoever all these people are runing these services (and talk about a lack of visible business model…), the bigger ones you can guess by watching the URLs pass in your status bar are running on Amazon Clouds which means they can scale better then your humble web server.

For our site, I went back to a much simpler scheme, setting up a directory at http://nmc.org/go and inside of there sub-directories for every short url I might like to do say, http://nmc.org/go/godog that jumps to my blog — this is a stupid example, just to show you how I set it up. And it is okay for a few URLS, but if you have hundreds, maybe not as optimal.

So in that subdirectory is a one line index.php file that reads:

Using the PHP command to re-route to the given URL via a header message to the client. One could also do it by an HTML with an index.html file and a META redirect in the HEAD:

which is less clean as there is a delay noticeable to the user.

If you run a WordPress site, there is the nifty TwitterFriendly Links plugin which creates a short URL based on the WordPress database id of a post, so this post can be read by http://cogdogblog.com/3709.

But actually, for my NMC work, I just stumbled into an ideal solution that is available to sites using Google Enterprise Apps (we use for mail, docs, calendar, etc) there is a Google Labs add on for a URL shortener — it keeps stats, and is very flexible. I just set it up, and am still playing with the settings.

You could really get worried about the consequences of having a bunch of URL shortened links on your site going south if your favorite cryptic named service flops. If it were me, I might at least keep a document going somewhere mapping the shortened URLs to where they should go, just in case you need to go back and fix them. I am not predicting ro suggesting these services will go up in smoke, but better prepared than surprised…

If you are looking for a thorough comparison, see Search Engine Land’s Which Shortening Service Should You Use?

Leave a Reply

Your email address will not be published. Required fields are marked *