Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am tired of using external URL shorteners, my favorite "tr.im" went out of business. I know there are some that will do reporting for me, but I want to run my own, so I can see the usage myself, for my own, not for public use.

Are there software packages that serve this niche? I don't necessarily want to allow third parties to use it, but I would like it to integrate into other software, like some Twitter tools or WordPress, if that's a possibility rather than always having to go to the site to log in.

What are my options for tools for running my own shortener? Assume I've done the easy part, buying a short domain.

And any other comments or tips on what makes a good shortener are welcome, but optional.

share|improve this question
    
Just curious--what advantages do you see in running your own URL shortener versus using a 301 shortener service? As mentioned, it's not hard to do, though integration with 3rd party services will take time. While you'd definitely have much more control over things, I can't really think of any tangible benefits off the top of my head. –  Lèse majesté Nov 18 '10 at 18:21
    
How about disadvantages? tr.im was quite good, with metrics and flexibility, and went out of business. *.ly shorteners are good, but depend on the goodwill of the Libyan government. External sites may share or sell link data with 3rd parties. By running my own, I avoid these pitfalls. Do those issues help you understand where I'm coming from? –  artlung Nov 18 '10 at 18:26
    
I think you got unlucky with tr.im, and if you got your own .ly domain it would depend on the goodwill of the Libyan government as well. But if you're worried about service availability, goo.gl is a safe bet, as Google is likely to outlive all of us. Though if Twitter is using Bit.ly, I don't think the rest of us need to be worried about it. Though it does occur to me that if you have your own shortener, you could use short slugs (e.g. goo.gl/superbowl, bit.ly/popedies, etc.) instead of arbitrary strings. –  Lèse majesté Nov 19 '10 at 2:45

4 Answers 4

up vote 1 down vote accepted

Just adding this for your consideration. I use this package and like it a lot > http://yourls.org/

Cheerio.

share|improve this answer
    
Are there others you evaluated? Do you use it in concert with Twitter or WordPress or other tools? Pluses, minuses? Nice find, but more detail about why you like it would be great. Thanks! –  artlung Nov 18 '10 at 17:25

Setting up a URL shortener isn't really that hard if it is for your use only. In order to integrate with with Twitter and WordPress you will have to develop you own API and plugins and that is the difficult or at least time consuming part. I think the basic steps would be.

  1. Buy a short URL and get hosting for it.
  2. Create a redirection engine in the language of your choice. This would be a piece of code that takes a long URL and creates a short one by generating a 4-6 digit code. Since it is for your own use it could be as simple as creating a table that has the long URL and PK that is an identity column. You can then use the ID column as your short URL. Meaning if your first entry is www.example.com and your short url is ex.amp then ex.amp/1 would redirect to www.example.com.
  3. Build an API using REST or SOAP that allows you to securely add a new entry and retrieve the generated Short URL.
  4. Code the tools for Twitter, Wordpress etc.

A side note, is somewhere in step 2 you would need to create your analytics code to track all the information about who hit your links.

share|improve this answer

You can try out YOURLS. It is PHP-based and use MySQL so it should work on whatever host you're using. The nice thing is that it's GPL licensed. It looks great and the stats are very helpful.

share|improve this answer

One more thing to think about is something like bit.ly Pro. You can have your own domain, but with all the speed and analytics from bit.ly.

I know that it's still relying on someone else's service, but bit.ly is probably the biggest provider on the web so if they went down, a hell of a lot of people's links would break

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.