ExternalRedirects

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

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
ExternalRedirects
ExternalRedirects#Changelog
Parameters $wgEnableExternalRedirects, $wgExternalRedirectProtocols
Example example in this wiki
Hooks used

ArticleAfterFetchContent

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.

Download

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.

require_once("$IP/extensions/ExternalRedirects/ExternalRedirects.php");
$wgEnableExternalRedirects = true;
$wgExternalRedirectProtocols = array('https', 'http', 'ftp');
$wgEnableExternalRedirects
A simple kill-switch in case this extension is abused by spammers. $wgExternalRedirectProtocols allows you to configure what protocols are detected as external redirects.
$wgExternalRedirectProtocols
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.

Changelog

1.5.5
  • Improve regex matching external redirects so URLs can include "()".
  • Move repository to github.
1.5.4
  • Remove use of deprecated functions
  • Set a required property in special pages
  • Code-style cleanup
1.5.3
  • 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.
1.5.2
  • Made regex that matches ExternalRedirects case-insensitive
  • Some code-cleanup in ExternalRedirects.php
1.5.1
  • 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.
1.2.1
  • fixed a bug that caused broke external redirects with braces in their linktext.
  • all in all more elaborate regular expressions
1.2
  • 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.
1.1
  • Refine matching of Redirects so they now accecpt categories.
1.0
  • First version documented here.

Licence

GPL v3 or any later version.