How to use bitly.Pro to set up a custom URL shortener
Over the last few months, custom URL shorteners have become all the rage. You've probably seen links that point to goo.gl (Google), fb.me (facebook), or nyti.ms (New York Times). In the twittersphere, the 140 character limit is a barrier that is all too easy to hit, and so there has been a clear need for URL shortening services to save characters when posting links. Of the various services available, bit.ly has reigned supreme (though tinyurl.com was the undisputed king for many years in the 'pre-twitter' era). However, it is not always easy to see where a bit.ly link will take you and so custom URL shorteners at least give you some sense of confidence that a nyti.ms short link can be trusted to only ever take you to a New York Times page. This week I decided to create my own URL shortener. I have to admit that this is partly a vanity project, but it's also partly due to curiosity to see how difficult the process would be. I thought I'd share the steps that I took, steps that were performed in conjunction with a free service from bitly.Pro (still in beta).
1) Find a suitable domain name
If you want a custom URL to reflect your name (or your business name) then the first step is to find a country which has a suitable two-letter TLD code. For business names, you might have more freedom to be a little bit more generic (such as fb.me for facebook), but for your own name, you really have to find a country that has a two-letter code that corresponds to the last two letters of your first or second name. This Wikipedia page is a great place to start your search. Certain names, e.g. Jude, Peter, or Suzie, are going to be more suitable than others as potentially you could form short URLs such as ju.de, pet.er, and suz.ie (corresponding to TLDs from Germany, Eritrea and Republic of Ireland respectively).
At this initial step you may run into various complications, the most likely of which is that there is no suitable country for the last letters of your name. If you are called Joe, you are out of luck as no country has a .oe TLD (though jose.ph might be possible). Therefore, you may have to be flexible. The second complication is that the name might already be taken. This will no doubt become more and more common in the coming months. Thirdly, there may be a suitable TLD available but there may be additional restrictions which make it unsuitable. E.g. I originally was hoping to get a Thailand domain name: kei.th. However, in Thailand you can't register just .th names, it has to be something such as .co.th. So in the end I chose bradn.am (an Armenian domain name). This leads us into step 2...
2) Register your domain name
Some countries have made a lot of money from letting people use their domain name, even when they don't live or do business in that country. For many small countries, their domain name has become a great asset to their economy. E.g. the Polynesian island nation of Tuvalu did a deal with VeriSign to lease their .tv domain name for $50 million in royalties (though I still don't think I've ever visited or seen a .tv website). This means that certain countries might charge a higher registration fee if you are not a resident of that country. This was a question that I was specifically asked by my Armenian domain registrar.
Connected to this point, is that the big domain name registrars (e.g. Go Daddy) usually don't handle registration for many country-specific domains. In my case I had to find an Armenian specific domain registrar. A good starting point is to go to the Wikipedia page corresponding to your chosen TLD and follow the 'registry' link on the right hand side of the page. This link should take you to the national organization responsible for registering domain names in that country, and hopefully from that page there will be links to individual companies that will let you register. At this point, I found that some Armenian registrars have, how shall we say, less professional looking websites than others? Be careful before handing over your credit card details to a company in another country! In the end I found an Armenian registrar that I liked the look of and which had a very good website which explained everything (Domain Shop).
3) Set up a bitly.Pro account
Like I said earlier, this is still a beta program, but it is free to sign up to join. You just need to have an existing bit.ly account (which is also free). After you have successfully set up an account, they will want you to do two things in order to get your URL shortener to work...
4) Point your custom domain name towards bitly.Pro
Technically, bit.ly will want you (or your registrar) to modify something called the 'A-record' and point it towards an IP address (168.143.174.97) that corresponds to the bitly.Pro website. This effectively means that, in my case, whenever someone types in any web address starting with bradn.am, it will be redirected to bit.ly's servers (though the URL doesn't change). Some registrars let you modify this information yourself via a web interface. In my case, I simply emailed my Armenian registrar and they made the change within minutes (thank you guys!).
5) Prove that you own another domain that the short URLs can point to
The main use of short domain names is that they should point to another (longer) domain. In my case I can use bradn.am links to point towards any pages I host at keithbradnam.com. So bit.ly want you to prove that you own (another) domain name, which they refer to as a tracking domain. Specifically, bit.ly will want you to do one of three things: upload a file that they provide to your website; add some specific HTML code to a webpage on your site; or set a CNAME record to point to the cname.bit.ly subdomain. If you own your website, it should be fairly easy to do at least one of these things.
6) Use your custom URLs
Once bit.ly has verified steps 4 and 5, you are free to start shortening URLs using your short domain name. You can of course create short URLs with your short domain name by using the bitly.Pro website, but I much preferring using the great bit.ly sidebar which can be launched from a browser bookmark. This will automatically switch to using your short domain name rather than 'bit.ly' as the prefix to the shortened URL. I couldn't find any way of turning this off, so in my case the short URLs that I create using the sidebar now start with eight characters (bradn.am) rather than six (bit.ly).
As I discovered from using the sidebar tool, your short URLs don't actually have to point to your own website, they can point to any web page. This means, that you can use shortened URLs as a way of indicating that you trust a link. Anyone that knows you and sees your short domain name used in a link might hopefully assume that the link is safe to click. When you use shortened links that point to your 'tracking domain' (see previous step), the bitly.Pro website will keep statistics on the use of those short URLs.
A nice feature of the bit.ly sidebar is that it allows you to make custom short URLs. E.g. rather than have a short URL that contains a string of random characters (e.g. http://bradn.am/aUn6Zh) I can instead make a link such as http://bradn.am/aboutkeith. In this case the custom link points to my 'About me' page on keithbradnam.com. However, if the custom part of your link is longer than 6–7 characters, then you could argue that it is no longer a short URL at all. You are also restricted in your choice of custom URLs as certain keywords appear reserved or already taken.
A final point worth mentioning is that if you are registered with bit.ly (i.e. you have a regular bit.ly account, not necessarily a bitly.Pro account), you can get details of an API key. This key can be used by other programs to access details of your bit.ly account. I was pleased to see that twidroyd, my preferred Android Twitter client, allows you to enter a bit.ly API key and this has meant that if I shorten any URLs when using twidroyd, they get shortened using my bradn.am domain name.