Update: Bitly Pro is now just Bitly
We recently used bit.ly pro to implement custom short urls for 511contracosta.org – with 511cc.org. Its currently a free service and works the same as bit.ly shortened URLs, only with a custom domain name of your choosing. Amazon just announced yesterday that they are using bit.ly pro for custom URLs using amzn.to.
Things worked great, and it was easy to set up the custom url with bit.ly pro by changing the A record for the domain name, however this meant that anyone going to 511cc.org directly with no hash on the end would be redirected to bit.ly’s main page. We needed this to redirect to a URL of our choosing, in this case 511contracosta.org. This isn’t an option in bit.ly pro, according to their FAQ its only available for bitly.Pro Enterprise users which costs $995/month. This was way beyond our price range.
Fortunately, its pretty easy to use .htaccess to carry out this.
- First, you need to set up the short domain name to use namesevers that point to a hosting account you control. For us, this was Media Temple so we set nameservers to ns1.mediatemple.net and ns2.mediatemple.net.
- Next, add a file called
- The contents of the .htaccess file should be:
RewriteEngine onRewriteRule ^/?$ http://511contracosta.org [L]RewriteRule ^(.*)$ http://bit.ly/$1 [R=301,NC]
- You should replace “http://511contracosta.org” with the domain name you’d like to redirect the root to
- Enjoy bit.ly pro, with at least one feature of bitly.pro enterprise