|
Cookbook /
Bloge-ShortUrlSummary: Get short URLs on your own site
Version: 2009-08-28
Prerequisites: PmWiki 2.2.x
Status: beta
Maintainer: Eemeli Aro
Download: bloge-shorturl.phpΔ
DescriptionGiven the inherent uncertainty in using external URL shorteners such as tr.im or bit.ly, it's sensible to manage short URLs on your own site—assuming, of course, that the path to your wiki isn't too long to start with. Bloge-ShortUrl will manage this map for you. Bloge-ShortUrl is a part of Cookbook.Bloge, but may also be used as a standalone recipe. Installation
UsageThe mapping of short URLs to actual page names is kept on the page The short URL for a page, if one exists, can be found using a new page variable By default Bloge-ShortUrl will take over a (hopefully) non-existing group 'S', such that request for pages such as For even shorter URLs, web server redirection can be used. For example, with the following Apache directive short URLs on pmwiki.org could have the form RedirectMatch ^/x(.*)$ /wiki/S/$1
Note that this kind of mapping will also require you to manually set the value of NotesThe A page is added to the short URL map when it's edited while the recipe is enabled. When adding a new page, the recipe will assume that Short URL auto-discovery is supported by adding a Bloge-core sets the following default value to the filter array: $ShortUrlFilter = array('!^Comments\.!', '!-Draft$!');
The internal value of a code makes use of PHP's base_convert function, hence the limitation to only using the characters 0-9 and a-z. This means that two-character codes will take you to 1296 pages and three characters to 46656. If you get to that point you probably shouldn't be using this recipe anymore. Release notes
See also
ContributorsComments
User notes? : If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |