Extension:SuppleRedirect
SuppleRedirect Release status: stable |
|
---|---|
File:WikiLink+Redirect.png | |
Implementation | Link markup |
Description | replace red-link to redirect other site automatically. |
Author(s) | Kimagurenote (Corytalk) |
Latest version | 1.0.0 |
MediaWiki | 1.35+ |
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 |
Expand | |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
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
- <translate> <tvar name=1>Download zip file from author's website, unzip it</tvar> and place the file(s) in a directory called <tvar name=name>
SuppleRedirect
</tvar> in your <tvar name=ext>extensions/
</tvar> folder.</translate> - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
/* 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/";
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
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
- SuppleRedirect (author site, written in Japanese)
- API:REST API
- Manual:Redirects
- Extension:RemoveRedlinks
- Extension:MissedPages
- Pages with script errors
- Pages with broken file links
- Stable extensions
- Link markup extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- BSD licensed extensions
- HtmlPageLinkRendererEnd extensions
- BeforeDisplayNoArticleText extensions
- All extensions
- Extensions not in ExtensionJson
- HTML head extensions
- Page existence detection
- Redirect extensions
- Referencing extensions