Nov 29Setup Your Own Custom Short Domain
This video is going to show you how to quickly setup your own Url shortener using code from yourls.org and to how to tie the shortener with your WordPress site.
Getting the Short domain
First thing you will need to get is a short url. I recommend using Domai.nr to search for short domains. Since most of the short domain extensions are controlled by foreign governments it can often take weeks to be processed and they are often more expensive than a “.com”. For example our short url, lgc.by, took about 6 weeks to process.
Setting up the Code
After you have your short url you’ll need to point it to your webhost. You’ll also need to create a database for the service and just keep the login credential handy (you’ll need them in a moment). Next go to yourls.org and download the code. After it is done downloading, you’ll want to unzip the files and open config-sample.php which is in the includes folder. Modify the config file to match your database information, put your short domain where it is requested and make sure you set a username & password. You can review the other settings to see what fits your needs but, I would suggest if you set the system as public you also set unique urls to false. The reason why I suggest this is because if you open the system up there is a high likely hood that users are going to want to add the same url others have. When you are done modifying the file you’ll need to rename it from config-sample.php to config.php and finally upload all the files to your server.
Using the Shortener
Once all the files are uploaded you will go to yourshortdomain.com/admin/ and the system will prompt you to install. This will just take a moment and you’ll be able to login to the system. That is pretty much it, once you are in the system you can add your urls and the system will create a short url for you. Under tools there are some bookmarklets that you can drag to your bookmark bar so you can use your shortener while you are browsing the web. Another alternative is to type yourshortdomain.com/http://www.the superlongurl.com/ and the system will automatically create a short url for you.
Random Keyword Plugin
Now if you are use to how twitter or bit.ly shortens urls you’ll notice that this system starts with simple numbers as unique ids instead of a short unique id. If you prefer the way twitter does it where it will use a random string of letters and numbers then you will want to install the Random Keyword Plugin. You’ll want to copy the code and add ?> to the end of the file. Create a folder called random-keyword in the user/plugin/ folder and save the file asĀ plugin.php. After you have uploaded the new folder you can go to the the plugins page of the admin and activate the plugin. Now when you add a long url the system will generate a short random string for the short url id.
Integrating the Short Url with WordPress
Now that you have your url shortener setup you should tie it in to your WordPress site. You’ll want to go to the Add New plugin section of your WordPress install. Search for yourls and around the 3rd result will be the result Yourls: WordPress to Twitter. Install and activate the plugin. After it is activated go to the settings section, if the shortener you setup is on the same server you could, use local and enter the path to the main directory or if it is not on the same account you would use remote with your details.
After you have told the system where your shortener is you’ll need to create a twitter applications for the system to work. It should only take a moment to setup, there is a link in the settings section and when you are done twitter will give you four unique keys for your applications. Add the keys to your system and then decide if you want the system to create a short url for posts, pages, and media or just some of those. You can also have the system send a tweet as soon as you publish a new post, page or media.
That is it! You’ll now be able to use your own short url when sharing your content.




