Redirect root domain of custom short URLs using pro

Update: Bitly Pro is now just Bitly

We recently used pro to implement custom short urls for – with Its currently a free service and works the same as shortened URLs, only with a custom domain name of your choosing. Amazon just announced yesterday that they are using pro for custom URLs using

Things worked great, and it was easy to set up the custom url with pro by changing the A record for the domain name, however this meant that anyone going to directly with no hash on the end would be redirected to’s main page. We needed this to redirect to a URL of our choosing, in this case This isn’t an option in 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 and
  • Next, add a file called .htaccess
  • The contents of the .htaccess file should be:

  • You should replace “” with the domain name you’d like to redirect the root to
  • Enjoy pro, with at least one feature of enterprise

18 thoughts on “Redirect root domain of custom short URLs using pro

  1. Pingback: Introducting – our new URL shortener | The Adventures of Chris Schultz
    1. Glad this worked for you. We've now switched away from using bitly pro to a self-hosted implementation of YOURLS – a php script that offers the same features as pro but doesn't share the namespace. This means we can use anything for the trailing characters – like and not have to worry about conflicting with another user. Its very easy to set up and offers statistics and other customization options.

  2. I came across your blog post while I was searching for bitly’s “root domain redirect” feature. Glad I found about YOURLS. I’ll give it a try too! Thank you for sharing the tips!

  3. This is awesome, I implemented it a while ago on and it works brilliantly.

    However, I really wanted to have custom short URLs and didn’t want to use YOURLs because it’s a bit of a hassle (compared to using, and because there are so many plugins available that work directly with which made this even easier to use (since automatically returns your custom URL to the plugins).

    Instead, I figured out a way of creating your custom short URLs in the .htaccess file! I’ll blog a tutorial and refer to this post since it was here that I got the initial knowledge, but all you have to do is add the following line before the rest of the RewriteRules:

    RewriteRule ^CustomShortURL$ BitlyShortURL [L]

    Note that this will also work going DIRECTLY to your resultant URL, rather than via

    RewriteRule ^CustomShortURL$ [L]

    For example, I have setup to go to, which I like because I get all of bitly’s reporting features. That looks like this:

    RewriteRule ^quiz$ nzutFQ [L]

    If I wanted to, I could send directly to my blog post.

    Hopefully, this will be useful to anyone who wants to use whatever short URL they want, and change at as and when they see fit 🙂

    P.S. If anyone fancies taking that quiz (, I’d REALLY appreciate it because it’s part of my master’s dissertation on Digital Literacy.

  4. Since I’m not seeing the result expected, I jsut want to make sure I’m doing it right:

    1. I created a file in notepad name only .htaccess, that had only the above 3 code lines.

    2. I uploaded the file to my host to the following folder: /x/dta

    3. I configured in my host 1and1 the domain to the following destination: /x/dta

    Still nothing happened.

    For the record, I deleted the Bitly html file and changed the A-record IP address back to 1and1. Neither of the changes stopped my custom shorted urls from working.

    Help, anyone?

    1. These instructions may not work on all hosts – make sure your host supports using .htaccess files and that you place it in the web root directory.

  5. Just an update for new readers. Bity might send you a similar email.

    You configured a custom short domain ( with bitly on October 25 2011. We have detected a configuration problem in the DNS for Please visit bitly for information on how to update your DNS settings.

  6. Hi, I know this hasn’t been comment on in 5 years, but hoping to see if there is a current solution for this same issue.

Leave a Reply

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