URL shortening services like TinyURL, bit.ly, etc. provide small aliases for long web addresses thus making it easier for you to share complex links through email, IM, Twitter, etc.
The only problem with URL shortening services is that most of them don’t have a solid business model yet so if they decide to shut shop in future, all your existing short links will become broken or point to non-existent 404 pages.
To prevent yourself from running into such a situation, you can consider setting up your own URL shortening service that will run on your own domain (or web server) and the short URLs will therefore resolve throughout the lifespan of your site.
Google Short URLs Service for Google Apps
Google provides an excellent URL shortening service but it’s only available for sites that use Google Apps for Domains. Other than providing memorable shortcuts to web URLs, Google Short Links service also offers standard analytics so you can know the usage level (or click-throughs) of individual URLs.
Here’s are some sample URLs that internally use the Google URL shortening service:
- go.labnol.org/facebook – Digital Inspiration on Facebook
- go.labnol.org/camera-phones – Uses of Camera Phones
To get started, add the Google Short Links service to your Google Apps domain. By default your redirection service will be available at links.example.com but you are free to choose any other sub-domain for this purpose. From the dashboard, open your Short Links settings and add a new URL (I picked go.labnol.org) and then deleted the default links sub-domain.
Next open your web domains cpanel and create a new CNAME record for the same sub-domain that should point to ghs.google.com as in the following screenshot.
Wait for a couple of minutes for the DNS changes to propagate across the Internet and your TinyURL clone is ready to serve. Here’s the default web interface where you can create short URLs using your Google Apps account.
Screenshot: Create your own short URLs

You can either create custom aliases or let the Google App itself choose a short URL for your web address but unlike the TinyURL service that does a 301 redirect, Google Short URLs do a 302 temporary redirect so the link juice, PageRank, etc. aren’t transferred to the original URL.
Tiny URLs created with Google Short Links offer another advantage – you can edit the underlying web page address so the short URLs will stay valid even if the underlying page has moved to a new location.
Screenshot: See usage count of short URLs

Run your own URL Shortening Service
Google Short Links are a perfect match for people who need a TinyURL like redirection service without involving any technical details. You don’t need any web server space and there are no MySQL databases or PHP scripts involved but the only downside it that your site must be running on Google Apps.
If you need to set up redirection on a site that doesn’t use Google Apps, try Shorty – it’s a free MySQL + PHP scripts that you may either set on sub-domain or a sub-directory under your main website.
With Shorty, you get a simple web interface to create as well as manage all your existing short URLs. Just upload all the installation files to your Apache server and run _install.php from the web browser. It also provides stats for individual short URLs.
Related: Create Short URLs for Google Search
Find this article at: http://www.labnol.org/internet/setup-tinyurl-like-redirection-service/8333/
Tags: Archives, How-to Guides and Software Tutorials, Most Popular, tinyurl, url shortening, Internet
Reader Comments
Wonderful tip Amit. But tweaking with CNAME settings is bit risky for non-techies.
Written by Chris M on 04.27.09
Well, This would be an alternate to using “gocodes” plugin on wordpress! Pretty easy to hide affiliate links too ;)
Written by Arun on 04.27.09
Thanks for the tip Amit. I created one for me.
Written by Hemanth Kumar on 04.27.09
Very useful tip Amit. We can also use our affiliate link using it? Is int it?
Written by Harsh Agrawal on 04.27.09
Google has everything covered! I’ll try that as well as shorty to set up my own url shortening service for a short domain name I picked up.
Written by Catherina on 04.27.09
Google always provides a useful new services. Thanks to Google and Labnol. I hope google provides free images hosting apps with cname support later
Written by Toni on 04.27.09
Thanks for the tip, Amit. Just set one up for my site.
Written by Raman Kaul on 04.27.09
..useful for posting links on twitter too, without losing your “brand”.
Written by Raman Kaul on 04.27.09
Thanks, Amit.
Till now I have been using sub-domains to redirect to various address (usually, my profiles at many social networks). And for GoDaddy, there is a limit on no. of sub-domains (maximum 90) we can have for a domain name.
I hope this is going to solve the problem. Thanks for the post.
And Google! I’m lovin’ it!
Written by Srikanth on 04.27.09
Hi Amit,
Thanks for this tip.
One update I would like to add – “You don’t need to update any CNAME settings, Google automatically does it for you.”
I think if you happen to register the domain name through Google only.
Thanks for this cool tip again.
Cheers
Anurag Bansal
Written by Anurag Bansal on 04.27.09
Excellent, that is what I need now
Written by David on 04.27.09
Can you explain what “Google Apps domain” is? My domain hosted with Godaddy. So how to use it?
Thanks for the head up.
Written by Defensive on 04.27.09
I followed this guide but it does not work at the end, it said go.blogviet.info not found on this server even I changed CNAMES records as guided. What is the solution? thanks
Written by Tinh on 04.27.09
I have been using Shorty and its a good tool to setup short urls.
Written by Joseph on 04.28.09
I think its enough to use the gocodes Wordpress plugin to get similar functionality. It creats links that look like site.com/go/custom-slug.
So you dont have to edit anything, and its easy to manage the links from within the Wordpress admin.
Its called Go Codes plugin, in case anyone need that, just google ‘Go codes’
Cheers :)
Written by Arun Basil Lal on 04.28.09
Hi
I followed your advice and found that my domain settings got nuked by enabling this new lab feature.
I had purchased my domain through Google at the time of getting Google Apps, which means that the domain is hosted by eNom.
In order to get everything back up and running, I needed to log onto eNom, manually add the MX records back in, and also create new CNAME entries.
I also would have lost some email, since due to the MX records having been removed, then the source mail servers will to try to redeliver the mail. They will just send an NDR to the sender, and not attempt to redeliver.
Once you get the MX records back into your DNS zone, then the source mail servers will spool mail if they can’t reach the destination SMTP servers.
I wrote up the steps I took at the following URL:
link
Written by Ron on 04.28.09
I tried get-shorty a while back and found some problems. Their forum’s most recent posting date appears to be 2007. Registering on the site does not get access to the forum, and they have never returned any emails directed at their web site support. Have you had any luck actually contacting them?
Written by stephan on 04.30.09
Snipurl has had this service for a long time. You can choose your own domain to run it with, and yet check short url usage stats on snipurl.com’s own website. Comparing with tinyurl is not terribly clever; it’s a one-feature service since the beginning.
Written by Matt Riley on 05.03.09