Extension:ExternalRedirect

The ExternalRedirect extension allows to create redirects to external pages in wiki.

Usage
A new parser function externalredirect with URL as first and only parameter is registered.

Place something like this on wiki page to make it redirect to external site:

This allows, for example, to add external links to Categories (by placing pages with externalredirect in them).

Download instructions
Download both .php files from GitHub (feel free to move this repository to MediaWiki Git) and place them in.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To load this extension, add the following to LocalSettings.php: Afterwards place required configuration parameters in LocalSettings.php (default values are shown here):
 * Array with numeric namespace IDs where external redirection should be allowed. For security reasons it is highly recommended to allow only write protected namespaces here.
 * Array with numeric namespace IDs where external redirection should be allowed. For security reasons it is highly recommended to allow only write protected namespaces here.


 * Array with page names (see magic word ) where external redirection should be allowed. It is better to avoid using this parameter (use $wgExternalRedirectNsIDs instead). For security reasons it is highly recommended to allow only protected pages here.
 * Array with page names (see magic word ) where external redirection should be allowed. It is better to avoid using this parameter (use $wgExternalRedirectNsIDs instead). For security reasons it is highly recommended to allow only protected pages here.


 * Whether to display link to redirection URL (along with error message) in case externalredirect is used where it is not allowed. Invalid URLs are never shown.
 * Whether to display link to redirection URL (along with error message) in case externalredirect is used where it is not allowed. Invalid URLs are never shown.

Security
This extension is meant for usage only on write-protected wikis/namespaces/pages. With version 1.0.2 there is introduced basic URL validation (using ) which prevents seriously malformed URLs, but still allows redirection to arbitrary sites.