Aus Free Software
Zur Navigation springen Zur Suche springen
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png

Release status: stable

Implementation Page action
Description This extensions allows you to use normal redirects to redirect to external websites. This extension is part of the PerPageResources project.
Author(s) Mathias Ertl (Mati talk)
Version 1.5.4 (2012-10-07)
MediaWiki 1.11.0+ (but most likely also older versions)
License GPL v3 or any later version.
Download see Download
Parameters $wgEnableExternalRedirects, $wgExternalRedirectProtocols
Example example in this wiki
Hooks used


The ExternalRedirects-extension allows you to use normal redirects to redirect to external websites. It does this by checking if the target of the redirect starts with one of the protocols defined in $wgExternalRedirectProtocols and redirecting to it if a match is found. The extension is part of the PerPageResources-project but can also be used standalone.


The source code of this extension was hosted on git.fsinf.at, a project no longer maintained. Since this extension was so old, the git repository was not transfered to any other repository and the source code is no longer available.

Installation & Configuration

Download ExternalRedirects.php and include these lines in LocalSettings.php.

$wgEnableExternalRedirects = true;
$wgExternalRedirectProtocols = array('https', 'http', 'ftp');
A simple kill-switch in case this extension is abused by spammers. $wgExternalRedirectProtocols allows you to configure what protocols are detected as external redirects.
Defines which protocols are recognized. The strings are actually used in a regular expression, so the above example would be equivalent to
$wgExternalRedirectProtocols = array('https?', 'ftp');
... which would make the 's' in "https" optional.

It is also recommended that you apply the HideExternalRedirects-patch so that Special:BrokenRedirects does not list External Redirects.


  • Improve regex matching external redirects so URLs can include "()".
  • Move repository to github.
  • Remove use of deprecated functions
  • Set a required property in special pages
  • Code-style cleanup
  • Update to work with new MediaWikis (requires 1.15.0 or later).
  • Handle external redirects that don't include a page text more gracefully.
  • This is the first version managed in git.
  • Made regex that matches ExternalRedirects case-insensitive
  • Some code-cleanup in ExternalRedirects.php
  • Added Special:ExternalRedirects.
  • Introduced $wgExternalRedirectsEnableSpecialPage that controls if Special:ExternalRedirects is listed or not
  • Some internationalization-work for the special page
Note: This changelog is retroactive from SVN-changelogs.
  • fixed a bug that caused broke external redirects with braces in their linktext.
  • all in all more elaborate regular expressions
  • Display of external redirects is now way cleaner. Text is now big but still shown as external redirect (--> image) and categories are shown as well.
  • Refine matching of Redirects so they now accecpt categories.
  • First version documented here.


GPL v3 or any later version.