Create Your URL Shortener From Your Domain

by YODspica Authors on September 17, 2009

YOURLS (Your Own URL Shortener) It’s a free PHP script created by Lester Chan and Ozh Richard that allow you to create something similar to TinyURL and Bit.ly.

YOURLS also comes with developer API as well as Wordpress plugin. In this post we show you simple guide on how to setup YOURLS.

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: http://yoursite.com/admin/install.php.

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


Please feel free to add a comment to this post, by clicking on title. Thank you.

Share and Enjoy:
  • Digg
  • Twitter
  • LinkedIn
  • Facebook
  • MySpace
  • Mixx
  • Reddit
  • Google Bookmarks
  • Diigo
  • DZone
  • Fleck
  • FriendFeed
  • Identi.ca
  • Ping.fm
  • Live
  • MisterWong
  • Netvibes
  • Propeller
  • Slashdot
  • StumbleUpon
  • Technorati
  • Current
  • Tipd
  • Tumblr
  • Sphinn
  • IndianPad
  • Wikio
  • del.icio.us
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • HelloTxt
  • DotNetKicks
  • HackerNews
  • Posterous
  • Zac
    This is a great tool - thank you.

    For my implementation, I didn't want to have Yourls in the root directory (to avoid clutter). It took quite some messing around to customize it for a different location.

    I suspect I am not alone. I also wonder how many people overwrite their existing .htaccess with yours during the install...

    Suggestion - provide an option in the config.php for an installation outside of the root.

    Thanks again!
blog comments powered by Disqus

Previous post:

Next post: