Custom Short URLs for a Website

In 2011, I needed an easy way to promote to one of my online projects on New York tourism to smartphone users and to do this, I needed to research how to create custom short URLs for a website.

Domain Name
My first task was to register (411ny.org) a shorter domain name then drop the following code into the .htaccess file in the root of the site.

# [ Custom Short URL ]

RewriteEngine on

RewriteRule ^/?$ http://411newyork.org [R=301,L]

RewriteRule ^(.*)$ https://bitly.com/$1 [R=301,NC]

# [ Custom Short URL ]

Bitly Pro Account
With the domain name registered, active, and loaded with the .htaccess file, it was time to register for a Bitly account so I can track stats and receive the API information to tie into my domain. Now, when a user types in 411ny.org/ZXMMS4 or http://411ny.org/1Q8pcfZ in the browser, they are redirected to this article and without having to pay enormous fees as what Amazon, Pepsi and news agencies would be paying.

The following two tabs change content below.
facebook-profile-picture

Stephan Pringle

Technology Support Specialist at Sipylus
About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.
facebook-profile-picture

Latest posts by Stephan Pringle (see all)

facebook-profile-picture

Stephan Pringle

About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.