Title
YOURLS: Your Own URL Shortener
Go Home
Description
Address
Phone Number
+1 609-831-2326 (US) | Message me
Site Icon
YOURLS: Your Own URL Shortener
Page Views
0
Share
Update Time
2022-05-07 09:27:40

"I love YOURLS: Your Own URL Shortener"

www.yourls.org VS www.gqak.com

2022-05-07 09:27:40

YOURLS: Your Own URL ShortenerMoreFAQAPIYOURLS pluginsConfigInstall/UpgradeAbout➤About YOURLS➤What is YOURLSYOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or Bitly).Running your own URL shortener is fun, geeky and useful: you own your data and don't depend on third-party services. It's also a great way to add branding to your short URLs, instead of using the same public URL shortener everyone uses.➤YOURLS FeaturesFree and open-source software,Private (your links only) or Public (everybody can create short links, fine for an intranet),Terrific Plugin architecture and dozens of plugins to easily implement new features,Handy bookmarklets to easily shorten and share links,Awesome stats: historical click reports, referrers tracking, visitors geo-location,Developer API to integrate YOURLS into other applications,Friendly installer,Sample files to create your own public interface and more !➤ScreenshotsMain admin dashboardStats for each short URL➤DownloadDownload YOURLS from GitHub and see see the Install guide➤CreditsYOURLS is made by awesome people.Keep up to date: read the official YOURLS Blog.➤Fresh InstallUnzip the YOURLS archiveCopy user/config-sample.php to user/config.phpOpen user/config.php with a raw text editor (like Notepad) and fill in the required settingsUpload the unzipped files to your domain public_html or www folderCreate a new database (see Configuration – you can also use an existing one)Point your browser to http://your-own-domain-here.com/admin/➤Install Guides The documentation on docs.yourls.org is full of important information. Regarding installation, you'll find help for Apache and Nginx. You will also find numerous unofficial installation guides on Awesome YOURLS, a curated list of resources.➤UpgradeBackup the database!Unzip the YOURLS archiveUpload files to your server, overwriting your existing install (this won't affect user files such as config or plugins)Point your browser to http://your-own-domain-here.com/admin/➤Configuration (in user/config.php)➤MySQL settingsYOURLS_DB_USERyour MySQL usernameExample: define( 'YOURLS_DB_USER', 'joe' );YOURLS_DB_PASSyour MySQL passwordExample: define( 'YOURLS_DB_PASS', 'MySeCreTPaSsW0rd' );YOURLS_DB_NAME:The database nameExample: define( 'YOURLS_DB_NAME', 'yourls' );YOURLS_DB_HOSTThe database hostExample: define( 'YOURLS_DB_HOST', 'localhost' );YOURLS_DB_PREFIXThe name prefix for all the tables YOURLS will needExample: define( 'YOURLS_DB_PREFIX', 'yourls_' );➤Site optionsYOURLS_SITEYour (hopefully short) domain URL, no trailing slash, lowercase. If you pick the non-www version of your domain, don't use the www version in your browser (and vice-versa)Example: define( 'YOURLS_SITE', 'https://your-own-domain-here.com' );YOURLS_PRIVATEPrivate means the admin area will be protected with login/pass as defined below. See Private or Public for more.Example: define( 'YOURLS_PRIVATE', 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: define( 'YOURLS_UNIQUE_URLS', 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 https://yourls.org/cookieExample: define( 'YOURLS_COOKIEKEY', 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm' );yourls_user_passwordsA list of username(s) and password(s) allowed to access the site if privatePasswords can either be in plain text, or encrypted: see https://yourls.org/userpassword for more information.Example: 'joe' => 'mypassword'➤URL Shortening settingsYOURLS_URL_CONVERTURL shortening method: base 36 or 62. See FAQ for more explanationsyourls_reserved_URLA list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywordsExample: 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick'➤Optional settingsYOURLS_PRIVATE_INFOSIf YOURLS_PRIVATE is set to true, you can still make stat pages public. To do so, define with:define('YOURLS_PRIVATE_INFOS', false);YOURLS_PRIVATE_APIIf YOURLS_PRIVATE is set to true, you can still make your API public. To do so, define with:define('YOURLS_PRIVATE_API', false);YOURLS_NOSTATSIf YOURLS_NOSTATS is set to true, redirects won't be logged and there will be not stats available.➤Advanced settings You can install YOURLS behind a firewall or a proxy: see Proxy Support File includes/Config/Config.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. There are numerous tips and guides on the Documentation, be sure to read them. ➤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 and you can easily activate and deactivate a plugin from the admin interface.There's a growing number of plugins available: check the Plugin list.➤DocumentationSeveral 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➤FeaturesGenerate or get existing short URLs, with sequential or custom keywordGet some statistics about your links: top clicked links, least clicked links, newest linksOutput format: JSON, XML, or simple raw textAuthentify either with login/password or using a secure passwordless mechanism➤UsageYou need to send parameters to http://your-own-domain-here.com/yourls-api.php either via GET or POST (remember to URL-encode parameters if via GET). 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), "stats" (get stats about your links) or "db-stats" (get global link and click count)With action = "shorturl" :the url to shortenoptional keyword and title for custom short URLsoutput format: either "jsonp", "json", "xml" or "simple"With action = "expand" :the shorturl to expand (can be either 'abc' or 'http://site/abc')output format: either "jsonp", "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 "jsonp", "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 "jsonp", "json" or "xml"With action = "db-stats" :output format: either "jsonp", "json" or "xml"With action = "version" :output format: either "jsonp", "json", "xml" or "simple" ➤Sample requests Example of a GET request with Javascript (using jQuery) to shorten a URL var api_url = 'http://sho.rt/yourls-api.php';var response = $.get( api_url, { username: "your_username", password: "your_password", action: "shorturl", format: "json", url: "http://ozh.org/" }, // callback function that will deal with the server response function( data) { // now do something with the data, for instance show new short URL: alert(data.shorturl); }); Example of a POST request with PHP to expand a short URL <?php$username = 'your_username';$password = 'your_password';$api_url = 'http://sho.rt/yourls-api.php';// Init the CURL session$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $api_url);curl_setopt($ch, CURLOPT_HEADER, 0); // No header in the resultcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return, do not echo resultcurl_setopt($ch, CURLOPT_POST, 1); // This is a POST requestcurl_setopt($ch, CURLOPT_POSTFIELDS, array( // Data to POST 'shorturl' => 'ozh', 'format' => 'json', 'action' => 'expand', 'username' => $username, 'password' => $password ));// Fetch and return content$data = curl_exec($ch);curl_close($ch);// Do something with the result. Here, we echo the long URL$data = json_decode( $data );echo $data->longurl;➤Sample returns Sample return in JSON format for the shorturl action { "url": { "keyword": "ozh", "url": "http:\/\/ozh.org", "title": "Ozh RICHARD \u00ab ozh.org", "date": "2014-10-24 16:01:39", "ip": "127.0.0.1" }, "status": "success", "message": "http:\/\/ozh.org added to database", "title": "Ozh RICHARD \u00ab ozh.org", "shorturl": "http:\/\/sho.rt\/1f", "statusCode": 200} Sample return in XML format for the expand action ozh http://sho.rt/ozh http://ozh.org/ success 200➤Sample fileThere's a sample PHP file included that serves as an example on how to play with the API➤Expand the APIYou can easily implement custom API actions with a plugin. See the plugin list for examples.➤FAQ➤Server requirements and recommendationsWe recommend PHP 7.4 or aboveYou will need at least MYSQL 5A web server with mod_rewrite enabledNote: YOURLS can also run on Nginx, Cherokee and more ! HTTPS supportPHP CURL extension installed if you plan on playing with the API➤LimitationsMaximum length of custom keyword is 100 charactersThat makes several septillions of quinquagintillion of possible short URLs (seriously. That's a 180-digit number). ➤Difference Between Base 36 And Base 62 EncodingBase 36 encoding uses 0123456789abcdefghijklmnopqrstuvwxyz for short URLsBase 62 encoding uses 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzStick 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 if you're not sure.➤Getting a short domain name for your YOURLS installUnless you plan on making it public and as popular as bit.ly, any shared hosting will be fine. Ozh runs all his YOURLS instance on Dreamhost and it works just great.Domainr is a fun search tool that might inspire and help youAim 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 .htaccessYou cannot install YOURLS and, say, WordPress, in the same directory. Both need to handle URLs differently and need their own .htaccess file.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 URLsMake sure mod_rewrite is enabled with your Apache serverMake sure your .htaccess file looks like this oneCheck that your server Apache configuration allows use of .htaccess (AllowOverride All directive, ask your server admin)Eventually, refer to Troubleshooting first steps.➤Random versus sequential short URLsOut of the box, YOURLS generates sequential short URLS (ie ab31, then ab32 and so on)If you prefer random short URLs (ie j3kz1 then 13hz7 like Bitly does), just activate the plugin that comes with YOURLS.➤"Stats don't update as I think they should", "difference with Google Analytics", etc...Out of the box, YOURLS updates traffic stats every time a short URL is requested. Period. This said, some clients (like indexing bots, your internet browser) may skip requesting a short URL if they have the final destination known in cache. Conversely, other stat tools may use different techniques to track hits (using javascript or not, using IP address, filtering multiple requests by same client, etc...)Bottom line: your mileage may vary with different tools, but there is no bug in YOURLS regarding that matter.➤There is no index page at the root of the installIndeed. It's intended. It's up to the user to make what they need. Some will redirect the root to a different place, some make a public interface for anyone to shorten links, some make a portfolio. You make it. See Awesome YOURLS for inspiration!If you want to make a public interface and run your own little bitly.com, there's a sample file provided as an example: sample-public-front-page.txt. This implies important issues to deal with: spam, performance and security. Read Public Shortening for important information.➤Uppercase letters in short URLs are eaten up, eg "OmgOzh" becomes "mgzh" !Indeed. It's intended if you selected Base 36 (see above). Letters that don't belong to the character set, eg @#! or ABC, are removed.If you want to force lowercase, you'll need a plugin.➤Feedback, feature requests and bug reportingPlease don't get in touch directly by mail or Twitter. Please.Read all the documentation.Search in all the issues, open and closed.Eventually raise a new issue. To do so, please read the contribute guidelines. Thanks!➤CommunityYOURLS is open source, so the community of users plays a great role in its development, by contributing, helping others or giving feedback that helps improve the software.➤ResourcesThe official YOURLS blog, for news, hints and showcase.The documentations: basic and advanced documentation, plugins, tips and more Awesome YOURLS is a curated list of YOURLS resources, plugins, translations, guides and third-party tools.➤Showcase YOURLS is used by dozens of thousands of users : inviduals, anonymous, celebrities, universities, small teams, huge companies. It is or has been used by Epic Games, the NASA, McLaren, Dreamhost and many more. You will find several examples of YOURLS implementations on Awesome YOURLS.➤YOURLS and other platforms or frameworks Contributors have made YOURLS work with various platforms, programming languages, applications or tools : Laravel, Symfony, WordPress, Perl, Ruby, Android, iOS, you name it. Head to Awesome YOURLS and find the missing tool you didn't know you were needing. #footer{width: 700px;margin-left: auto;margin-right: auto;background:rgba(255,255,255,0.5);border: 2px solid #2A85B3;-moz-border-radius: 10px;-webkit-border-radius: 10px;border-radius: 10px;margin-top:10px;font-size:90%;text-align:center;}Copyleft YOURLS 2009 - 2022. Note: this whole site is the actual readme file included with YOURLS. Neat huh?