Posted Apr 15, 2010
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 thi s 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.
RewriteEngine on RewriteRule ^/?$ http://511contracosta.org [L] RewriteRule ^(.*)$ http://bit.ly/$1 [R=301,NC]