Posted in Articles

How To Create URL Shortener With Your Domain

We use shortening URL services like TinyURL,,, etc on daily basis. These services are great, but have you thought of creating something similar your own? Setting up such service on your own is fairly easy, and if you are using WordPress it too comes with a plug-in that work seamlessly well.
YOURLS (Your Own URL Shortener) is what we’re talking about. It’s a free PHP script created by Lester Chan and Ozh Richard that allow you to create something similar to TinyURL and We’ve installed and played around with it for a while, and here are our thoughts:

  • Easy to install – If you’ve got no problem installing WordPress, then setting YOURLS is a piece of cake.
  • Customizable links – You can customize the links instead of the random characters that make no sense.
  • Statistics – An admin page that allows you to manage and keep track of details like date of creation, IP, clicks, etc.
  • Public/Private links– You control whether this service is available for public to use or yourself only.
  • Bookmarklet – Easy bookmarklet to create your own short URL on the fly.

YOURLS also comes with developer API as well as WordPress plugin. If you like the idea of owning a private url shortening services, please read on. We’ll cover a simple guide on how to setup YOURLS.

First and formost

Here are some things you’ll need before the installation:

  1. A domain – A short one would be perfect but it’s hard to get these days. If you are thinking of getting a really short one, we suggest you try your luck on country code top-level domains like .at, .lv, .ly, etc with
  2. PHP Supported account YOURLS runs on PHP, so you will need to make sure the server (dedicated or shared hosting) supports PHP 4.3 and MYSQL 4.1 and above with mod_rewrite enabled.

Read more about YOURLS requirements.

1. Download

Download the latest version of YOURLS. Unzip it and fire up your favorite text editor. We are about to do some configurations.

2. Configure

  1. Look for includes/config-sample.php, rename it to includes/config.php and open up in editor.
  2. Mandatory settings you’ll need to change are: YOURLS_DB_USER, YOURLS_DB_PASS, YOURLS_DB_NAME, YOURLS_SITE. Last but not least, change your password for username and username2. The rest of the settings are optional. We suggest you go through the entire thing, it’s pretty self-explanatory. Please drop us a comment if you have problem filling this, or check out the YOURLS configuration guide.
  3. Create a database – Create a database with the name you’ve inserted for YOURLS_DB_NAME. If your web hosting account provide you with cPanel, login and find “MySQL Database” under Databases column.

    create database

3. Upload

Upload all files and folders in the exact same structure to the root folder of your web hosting account. Your root folder name might varies from public_html, www, html, etc.
upload to server

4. Install

We are almost done now. Fire up a browser, type in your domain name as url, follow by /admin/install.php. For example:
If everything is setup correctly, you’ll see these following messages with the link to your admin page at the end of the line.
yourls install success

5. Done!

Go on, login and start creating your very own short URL. Make sure you check out the Tools too, if you’d like to make a bookmarklet. Here’s a sample of how our YOURLS admin page looks like.
yourls sample
Hope it works for you, drop us a comment if you have any questions 🙂



I’m Liah Qureshi ( My real name is Irtiqa Qureshi, I go with Liah as my pen name). Im a girl in my 20 somethings, trying my bit to make this world a better place to live in. I am a Journalist and a stick-to-radio person. I write sometimes when I think my writings can make some productive change. Apart from being a Journo and a radio freak, I work as a freelance Voice Artist, a Counselor, a Blogger, a YouTuber (this happens just sometimes and that too randomly plus i don't have a fan base or something like that on YouTube :P ), Social Activist and an Emcee too (all on an individual level). I love to study Psychology in my free time(If ever I get some). And I am Loving my Life. You can Check out my Social Media links given on this page.

One thought on “How To Create URL Shortener With Your Domain

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s