Extension:SuppleRedirect

Category:Extensions without a compatibility policyCategory:BSD licensed extensions
MediaWiki extensions manual
SuppleRedirect
Release status: stableCategory:Stable extensions
Implementation Link markup Category:Link markup extensions
Description replace red-link to redirect other site automatically.
Author(s) Kimagurenote (Corytalk)
Latest version 1.0.0
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
Database changes No
License BSD 3-clause "Modified" License
Download https://kimagurenote.net/kn/SuppleRedirect#Download
https://kimagurenote.net/kn/SuppleRedirect#History
Example https://kimagurenote.net/kn/SuppleRedirect#Usage
Category:All extensionsCategory:Extensions not in ExtensionJson

The SuppleRedirect extension provides a way to replace red links to redirect other site automatically if find same title on other sites by MediaWiki REST API (1.35+).

And set redirect automatically on new page also.

It useful to divide your site or build new sites.

Installation

  • Download zip file from author's website, unzip it and place the file(s) in a directory called SuppleRedirect in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    /* Extension:SuppleRedirect */
    wfLoadExtension( 'SuppleRedirect' );
    $wgSuppleRedirectRestURL['my'] = "https://mywiki.example.com/rest.php";
    $wgSuppleRedirectBaseURL['my'] = "https://mywiki.example.com/mywiki/";
    $wgSuppleRedirectRestURL['en'] = "https://en.wikipedia.org/w/rest.php";
    $wgSuppleRedirectBaseURL['en'] = "https://en.wikipedia.org/wiki/";
    $wgSuppleRedirectRestURL['ja'] = "https://ja.wikipedia.org/w/rest.php";
    $wgSuppleRedirectBaseURL['ja'] = "https://ja.wikipedia.org/wiki/";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

Permanently redirect

If you want to redirect permanently (e.g. using to divide your site), add this variable to LocalSettings.php.

$wgSuppleRedirectPermanently = true;

By default (if not set), may be used 307 Temporary Redirect.

Exclude some titles

If you want to exclude some titles, you can set $wgSuppleRedirectExcludes on LocalSettings.php as follows.

$wgSuppleRedirectExcludes = [ "Example", "Test" ];

You must set uppercase the first character because of MediaWiki's restriction.

But you may not restricted with $wgCapitalLinks = false.

Timeout

This extension timed out 60 seconds by default to call MediaWiki Rest API.

We recommend to set shorten "default_socket_timeout" on php.ini as possible.

Notes

Create new page

This extension replace red links automatically if same article provided on other site worked MediaWiki.

If you want to create a new page, open the full URL with redirect=no. for example:

https://yourwiki.example.com/index.php?redirect=no&title=New_article

e.g. on wikitext:

[{{fullurl:New article|redirect=no}} Create "new article" on this site]

Namespace problems

This extension works only workspaces NS_MAIN or $wgContentNamespaces.

This extension may meet problems being caused by translation in several namespaces (except NS_MAIN) and languages. details see here. (in Japanese)

Miscellaneous

This extension not affect by $wgInvalidRedirectTargets.

See also

Category:HTML head extensions Category:Page existence detection Category:Redirect extensions Category:Referencing extensions
Category:All extensions Category:BSD licensed extensions Category:BeforeDisplayNoArticleText extensions Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:HTML head extensions Category:HtmlPageLinkRendererEnd extensions Category:Link markup extensions Category:Page existence detection Category:Redirect extensions Category:Referencing extensions Category:Stable extensions