Extension:ShortUrl

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
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

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.

  1. Download a snapshot and extract it to your extensions directory.
  2. Add the following to the bottom of your LocalSettings.php
    require_once( "$IP/extensions/ShortUrl/ShortUrl.php" );
  3. Create the 'mediawiki.shorturls' table by running in your mediawiki instance:
    php maintenance/update.php

[edit] Usage

  1. When installed redirects are available under Special:ShortUrl/<base36>.
  2. Links to redirects can be found in the Toolbox and under the heading (javascript only)

[edit] Configuration

  1. (Optional) Run populateShortUrlTable.php maintenance script. Fills the shorturl database table with entries for all namespace/title parts of all currently existing articles.
  2. 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
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox