One of the best OpenSource (free) scripts I have seen for doing this is Yourls. You can download the code at google code. The current version is 1.4.3. It is a PHP script that requires at least PHP 4.3 and at least MYSQL 4.1. If you want to mess around with the API (yes it does have an API) it is recommended that you have Curl extension. It comes with a Wordpress plugin so that your Wordpress posts can be automatically Tweeted using your own URL Shortener (sweet).
Your first step is to get a really small URL. Be creative. Use top level domains like .me .ws .it .in .co or if you plan on using your own URL use a subdomain like s.mydomain.com (don't use www). You might try using Domai.nr to help you find good domain names.
As far as installation is concerned it is pretty straight forward. The instructions are located here. Probably the most important thing is to set up the database and the config file.
When you set up your MySQL Database remember to write down or remember the database name database user and database user password. You will need these value for the config file. When you create the database you do not need to worry about creating tables. The script will do this for you.
When setting up the config.php file (located in the includes file please note these important settings that you will need to set in red text.
MySQL settings
YOURLS_DB_USERyour MySQL usernameExample: 'joe'YOURLS_DB_PASSyour MySQL passwordExample: 'MySeCreTPaSsW0rd'YOURLS_DB_NAME: The database nameExample: 'yourls'YOURLS_DB_HOSTThe database hostExample: 'localhost'YOURLS_DB_PREFIXThe name prefix for all the tables YOURLS will need *DON'T CHANGE THIS VALUEExample: 'yourls_'
Site options
YOURLS_SITEYour (short) domain URL, no trailing slashExample: 'http://whatever.com'YOURLS_HOURS_OFFSETTimezone GMT offsetExample: '-5'YOURLS_PRIVATEPrivate means protected with login/pass as defined below. Set to false for public usage (on an intranet for instance)Example: 'true'YOURLS_UNIQUE_URLSAllow multiple short URLs for a same long URLSet to true to allow only one pair of shortURL/longURL (default YOURLS behavior), or to false to allow creation of multiple short URLs pointing to the same long URL (as bit.ly does)Example: 'true'YOURLS_COOKIEKEYA random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: generate a unique one at http://yourls.org/cookieExample: 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm'yourls_user_passwordsA list of username(s) and password(s) allowed to access the site if privateExample: 'joe' => 'mypassword'
URL Shortening settings
YOURLS_URL_CONVERTURL shortening method: base 36 or 62.yourls_reserved_URL- A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords
- Optional settings
YOURLS_PRIVATE_INFOSIfYOURLS_PRIVATEis set to true, you can still easily make your individual stat pages public. To do so, override the global private setting with:define('YOURLS_PRIVATE_INFOS', false);YOURLS_PRIVATE_APIIfYOURLS_PRIVATEis set to true, you can still easily make your API public. To do so, override the global private setting with:define('YOURLS_PRIVATE_API', false);YOURLS_NOSTATSIfYOURLS_NOSTATSis set to true, redirects won't be logged and there will be not stats available.
- http://hmm.ph/
Funny domain name, nicely styled - http://qte.me/
Another YOURLS setup with a cute quote look - http://mrte.ch/
Mr Tech's public YOURLS setup, listing top links and some stats - http://s4c.in/
Shorten 4 Charity, a public YOURLS setup with shortened links displayed within a frame containing ads for charities - http://girv.in/
John Girvin's YOURLS setup with all links in a sortable display - http://www.iyeman.net/
Example of portal for your online self with links to your places (blog, Twitter) and your URL shortener - http://li.nkto.me/
A nice domain name hack :) - http://vb.ly/
Public YOURLS setup run by famous sex writer Violet Blue as "the internet's first and only sex-positive url shortener" - http://chort.in/
A neat take on the word shorten. An interesting little site.
Did you know that you can create short urls with AdFly and earn dollars for every click on your short urls.
ReplyDelete