Extension:InterwikiDispatcher

The InterwikiDispatcher extension adds some simple multi-level interwikis for easier linking to wiki farms.

Hooking into existing interwiki prefixes to provide some limited API support. Subdomain part of the interwiki is validated as  to avoid open redirect vulnerabilities. Scary transclusion will work when enabled for the interwiki prefix.

Configuration
is the sole variable controlling this extension's behaviour. The format is an array (keys do not matter) where values are associative arrays of parameters. These parameters are:
 * (required): the interwiki prefix to apply this rule to.
 * This prefix must be a valid and defined interwiki prefix.
 * : optional sub-prefix, which will be expected right after the interwiki prefix. For example a prefix of and sub-prefix of  results in links of format   and.
 * (required): external URL format. Placeholder stands for page title,  for wiki domain.
 * Example:
 * : optional international external URL format. Placeholder stands for the language.
 * Example:
 * : if, falls back to the base, classic interwiki during scary transclusion.
 * Default:
 * : optional wiki ID format, used to check whether a wiki exists locally via $wgLocalDatabases. Placeholder is the wiki domain.
 * Example:
 * : optional international wiki ID format, used to check whether a wiki exists locally via $wgLocalDatabases. Placeholder is the wiki domain,  is the language.
 * Example:
 * : optional custom function to check if a wiki exists. This completely replaces the DB check of,.
 * : Takes this array as, domain as , language as (or empty string). Both  and  are out parameters: the callback may override them as needed.

Extension:Interwiki integration
When Extension:Interwiki is enabled, an additional table for "Multi-level interwiki prefixes" will be added to Special:Interwiki listing the interwikis managed by this extension.