Page Text: URL shortening method: base 36 or 62. See FAQ for more explanations
yourls_reserved_URL
A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords
Example: 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay'
Optional settings
YOURLS_PRIVATE_INFOS
If YOURLS_PRIVATE is 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_API
If YOURLS_PRIVATE is 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_NOSTATS
If YOURLS_NOSTATS is set to true, redirects won't be logged and there will be not stats available.
Advanced settings
File includes/yourls-load.php contains a few more undocumented but self explanatory and commented settings. Add them to your own config.php if you know what you're doing
WordPress Plugin
Generate short URLs for each new post or page
Generate short URLs for all your old posts and pages if wished
Send a tweet on your Twitter account with the post title and short URL as you publish them
Works if YOURLS is hosted on the same server or on a remote server
Also compatible with tr.im, is.gd, tinyurl.com and bit.ly for maximum fun
Screenshot
Download YOURLS: WordPress to Twitter from the official WordPress plugin repository
More information, tips and feedback on the plugin page from planetOzh
Plugins for YOURLS
Plugins?
Plugins are additional PHP scripts that extend the functionalities or features of YOURLS. The core of YOURLS is designed to be as light as possible and avoid bloat (implementing functions not everybody needs) and to allow for easy customization.
Using the plugin architecture, you can add new features to YOURLS without having to modify core files. This way, your changes won't be lost when you upgrade your YOURLS installation.
Documentation
Several sample plugins are included in the archive. Read the source and learn the concept. It's easy and fun!
Check the plugin API documentation to learn more
YOURLS' API
Generate or get existing short URLs, with sequential or custom keyword
Get some statistics about your links: top clicked links, least clicked links, newest links
Output format: JSON, XML, or simple raw text
Authentify either with login/password or using a secure passwordless mechanism
Usage
You need to send parameters to http://yoursite.com/yourls-api.php either via GET or POST. These parameters are:
A valid username / password pair, or your signature (see Passwordless API requests )
The requested action: "shorturl" (get short URL for a link), "expand" (get long URL of a shorturl), "url-stats" (get stats about one short URL) or "stats" (get stats about your links)
With action = "shorturl" :
optional keyword for custom short URLs
output format: either "json", "xml" or "simple"
With action = "expand" :
the shorturl to expand (can be either 'abc' or 'http://site/abc')
output format: either "json", "xml" or "simple"
With action = "url-stats" :
the shorturl for which to get stats (can be either 'abc' or 'http://site/abc')
output format: either "json" or "xml"
With action = "stats" :
the filter: either "top", "bottom" , "rand" or "last"
the limit (maximum number of links to return)
output format: either "json" or "xml"
Sample return
62019439011 shorter http://somereallylongurlyouneedtoshrink.com/ 2009-06-23 18:08:07 127.0.0.1 success http://somereallylongurlyouneedtoshrink.com/ (ID: shorter) added to database http://yoursite.com/shorter
Sample file
There's a sample file included that serves as an example on how to play with the API
FAQ
A server with mod_rewrite enabled
At least PHP 4.3
Note: YOURLS can also run on Nginx and Cherokee
Server recommendations
PHP CURL extension installed if you plan on playing with the API
Limitations
Maximum length of long URLs to be shortened is 2000 characters
Maximum length of custom keyword is 200 characters
That makes about 8 sexdecillions of centillions of available URLs ( seriously . That's a 355 digits number).
Difference Between Base 36 And Base 62 Encoding
Base 36 encoding uses 0123456789abcdefghijklmnopqrstuvwxyz
Base 62 encoding uses 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Stick to one setting, don't change after you've created links as it will change all your short URLs!
Base 36 is the default and should be picked.
Getting a short domain name for your YOURLS install
Unless you plan on making it public, any shared hosting should be fine
Domainr is a fun search tool that might inspire and help you
Aim for exotic top level domains (.in, .im, .li ...), they're often cheap and a lot are still available. Gandi is a pretty comprehensive registrar, for instance.
YOURLS needs its own .htaccess
You cannot install YOURLS and, say, WordPress, in the same directory. Both of them need to handle URLs differently
If you want to install YOURLS on the same domain than your blog, give it its own (short) subdirectory, such as yourblog.com/s/ (for "short") or yourblog.com/x/ (for "exit")
If YOURLS generates 404 for your short URLs
Make sure mod_rewrite is enabled with your Apache server
Make sure your .htaccess file looks like this one
Feedback, feature requests and bug reporting
Please don't get in touch directly by mail or Twitter. Please .
Check the Road Map for future features
Raise an issue here and give all the details. Thanks!
Showcase