Saturday, June 23, 2012

Branded Short URLs

Short links are great, but wouldn’t it be great to have your own such service, much like New York Times ( It turns out that there are at least three ways you can achieve this goal. We will be looking at Bitly Pro, Google Links and hosting your own.

The easiest setup is, undoubtedly, Bitly Pro. If you already have a domain name all you need to do is create an A record for it and point it to server (currently Just follow their instructions in the advanced settings. Currently, you can do so with only one such domain per account. You have the option to use forwarding on your naked domain (as we’ve done with, or set up a subdomain with either an A record or CNAME. Once set up in this manner, you can use it with older bitly shortcuts, such as, Bitly also provides a number of stats and it is quite possibly the most popular such service, which suggests that it will survive.


Google Short LinksAnother service that is likely to survive is Google Short Links, currently a “Labs” feature. If you are using Google Apps with your own domain, you just got to the Google Market using the link below and add it there.

Unlike Bitly, this service will not allow you to use your naked domain, nor will you be able to use an A record – at least not in its current incarnation. You will have to use a subdomain (we used go) set up a with CNAME record pointing to – you guessed it! –

Short Links Settings topOnce your changes have propagated, you can adjust a number of settings, including whether the “jump” is done via 302 or 301 redirect (temporary vs permanent), as follows:

20120623-002-screencapAs you might know, 302 allows the link juice, PageRank etc to be retained by your domain.


To use this free suite of PHP scripts, you need, apart from your own domain name, a server with mod_rewrite (most webhosts have that), PHP 4.3+ and mySQL 4.1+ – again, most hosting services easily meet and surpass these requirements.

You change settings via config.php.
    Your (short) domain URL, no trailing slash
    Example: ''
    Timezone GMT offset
    Example: '-5'
    Private means protected with login/pass as defined below. Set to false for public usage (on an intranet for instance)
    Example: 'true'
    Allow multiple short URLs for a same long URL
    Set to true to allow only one pair of shortURL/longURL (default YOURLS behavior), or to false to allow creation of multiple short URLs pointing to the same long URL (as does)
    Example: 'true'
    A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: generate a unique one at
    Example: 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm'
  • yourls_user_passwords
    A list of username(s) and password(s) allowed to access the site if private
    Example: 'joe' => 'mypassword'
URL Shortening settings
    URL shortening method: base 36 or 62. See FAQ for more explanations
  • yourls_reserved_URL
    A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords
    Example: 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay'
Optional settings
    If YOURLS_PRIVATE is set to true, you can still easily make your individual stat pages public. To do so, override the global private setting with:
    define('YOURLS_PRIVATE_INFOS', false);
    If YOURLS_PRIVATE is set to true, you can still easily make your API public. To do so, override the global private setting with:
    define('YOURLS_PRIVATE_API', false);
    If YOURLS_NOSTATS is set to true, redirects won't be logged and there will be not stats available.

YoURLs uses plugins and integrates tightly with Wordpress, should you choose to use it that way. Best of all, it’s free!


We do not recommend such services other than what we listed above, as it is quite easy to set up your own and if not, you can use Bitly or the free Others may offer value-added services: TinyArrows, budurl, XR. Whatever you choose, be happy!

Sources / More info: Google Short Links, bitly, yourls,

No comments:

Post a Comment

Thank you for commenting and rest assured that any and all comments are welcome, whether positive or negative, constructive or distructive. Unfortunately, if you comment in this view I might not know about - please use the regular (Desktop) view.
I am using Disqus for commenting, but Blogger is not showing it so your comments may end up not being displayed - tell Google about it!