Extension:ShortUrl
From MediaWiki.org
|
ShortUrl Release status: beta |
|
|---|---|
| Implementation | Special page |
| Description | Adds a special page that redirects to an article based on the given base36-encoded ID |
| Author(s) | Yuvi Panda |
| Last version | 2.0 (2011-04-11) |
| MediaWiki | 1.16 |
| License | BSD |
| Download |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes |
|
Check usage (experimental) |
|
ShortUrl is a special page extension that helps create shortened URLs for wiki pages, using their base36 encoded IDs. Adds a 'Short URL' link to the Toolbox. Primarily developed for use in the Indic Language Wikipedias.
Contents |
[edit] Installation
Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
- Download a snapshot and extract it to your extensions directory.
- Add the following to the bottom of your LocalSettings.php
require_once( "$IP/extensions/ShortUrl/ShortUrl.php" );
- Create the 'mediawiki.shorturls' table by running in your mediawiki instance:
php maintenance/update.php
[edit] Usage
- When installed redirects are available under Special:ShortUrl/<base36>.
- Links to redirects can be found in the Toolbox and under the heading (javascript only)
[edit] Configuration
- (Optional) Run populateShortUrlTable.php maintenance script. Fills the shorturl database table with entries for all namespace/title parts of all currently existing articles.
- Set $wgShortUrlTemplate to the template of the path for generating short URLs. $1 is replaced with the actual short url id.
[edit] Updates
[edit] May 07, 2011
- Updated to use PathRouter. Easier mod_rewrite rules + works with server implementations that do not have a mod_rewrite equivalent.
[edit] Nov 26, 2011
- Fixed changes suggested by Roan on code review
[edit] May 27, 2011
- Modified to include Wikitech list comments on the same, pending code review.
[edit] April 12, 2011
- Add support for arbitrary prefixes in toolbox (Support for mod_rewrite based shortening)
- Add 'Short URL' link to Toolbox.
[edit] April 1, 2011
- Initial Release