<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.traxel.com/index.php?action=history&amp;feed=atom&amp;title=MultiWiki</id>
	<title>MultiWiki - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.traxel.com/index.php?action=history&amp;feed=atom&amp;title=MultiWiki"/>
	<link rel="alternate" type="text/html" href="https://wiki.traxel.com/index.php?title=MultiWiki&amp;action=history"/>
	<updated>2026-04-28T19:57:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://wiki.traxel.com/index.php?title=MultiWiki&amp;diff=2895&amp;oldid=prev</id>
		<title>RobertBushman at 20:41, 28 September 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.traxel.com/index.php?title=MultiWiki&amp;diff=2895&amp;oldid=prev"/>
		<updated>2023-09-28T20:41:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:41, 28 September 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MediaWiki]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MediaWiki]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Website]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Multi-Wiki =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Multi-Wiki =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key traxel_wiki:diff::1.12:old-2894:rev-2895 --&gt;
&lt;/table&gt;</summary>
		<author><name>RobertBushman</name></author>
	</entry>
	<entry>
		<id>https://wiki.traxel.com/index.php?title=MultiWiki&amp;diff=2894&amp;oldid=prev</id>
		<title>RobertBushman: Created page with &quot;Category:MediaWiki Category:Website  = Multi-Wiki =  == Wiki farm: Practical == &lt;pre&gt; $wgLogos = [ 	'1x' =&gt; &quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&quot;, 	'icon' =&gt; &quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&quot;, ]; $wgDBtype = &quot;mysql&quot;; $wgDBserver = &quot;localhost&quot;; $wgDBname = &quot;iterativechaos_wiki&quot;; $wgDBuser = &quot;wiki_wiki&quot;;  ## Set $wgCacheDirectory to a writable directory on the web server #$wgCacheDirectory = &quot;$IP/cac...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.traxel.com/index.php?title=MultiWiki&amp;diff=2894&amp;oldid=prev"/>
		<updated>2023-09-28T20:40:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/Category:MediaWiki&quot; title=&quot;Category:MediaWiki&quot;&gt;Category:MediaWiki&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:Website&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Website (page does not exist)&quot;&gt;Category:Website&lt;/a&gt;  = Multi-Wiki =  == Wiki farm: Practical == &amp;lt;pre&amp;gt; $wgLogos = [ 	&amp;#039;1x&amp;#039; =&amp;gt; &amp;quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&amp;quot;, 	&amp;#039;icon&amp;#039; =&amp;gt; &amp;quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&amp;quot;, ]; $wgDBtype = &amp;quot;mysql&amp;quot;; $wgDBserver = &amp;quot;localhost&amp;quot;; $wgDBname = &amp;quot;iterativechaos_wiki&amp;quot;; $wgDBuser = &amp;quot;wiki_wiki&amp;quot;;  ## Set $wgCacheDirectory to a writable directory on the web server #$wgCacheDirectory = &amp;quot;$IP/cac...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:MediaWiki]]&lt;br /&gt;
[[Category:Website]]&lt;br /&gt;
&lt;br /&gt;
= Multi-Wiki =&lt;br /&gt;
&lt;br /&gt;
== Wiki farm: Practical ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$wgLogos = [&lt;br /&gt;
	'1x' =&amp;gt; &amp;quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&amp;quot;,&lt;br /&gt;
	'icon' =&amp;gt; &amp;quot;http://wiki-static.iterativechaos.com/iterative_chaos_logo_004.png&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
$wgDBtype = &amp;quot;mysql&amp;quot;;&lt;br /&gt;
$wgDBserver = &amp;quot;localhost&amp;quot;;&lt;br /&gt;
$wgDBname = &amp;quot;iterativechaos_wiki&amp;quot;;&lt;br /&gt;
$wgDBuser = &amp;quot;wiki_wiki&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
## Set $wgCacheDirectory to a writable directory on the web server&lt;br /&gt;
#$wgCacheDirectory = &amp;quot;$IP/cache&amp;quot;;&lt;br /&gt;
NO ENTRY FOR: $wgUploadDirectory = &amp;quot;$IP/images/$wgDBname&amp;quot;;&lt;br /&gt;
NO ENTRY FOR: $wgUploadPath = &amp;quot;/w/images/$wgDBname&amp;quot;;&lt;br /&gt;
## $IP is Install Path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are for running multiple wikis on same version of MediaWiki:&lt;br /&gt;
&lt;br /&gt;
# Install the first wiki as normal. For details, see Manual:Installation guide.&lt;br /&gt;
# Enable your web server to share your MediaWiki install with all wikis. For multiple (sub)domains, you can use listen on multiple server names. For multiple subdirectories, you could use rewrite rules, aliases, or symlinks.&lt;br /&gt;
# Add code to the top of &amp;lt;code&amp;gt;LocalSettings.php&amp;lt;/code&amp;gt;, to detect the current wiki. Note that if the argument to &amp;lt;code&amp;gt;--wiki&amp;lt;/code&amp;gt; contains a hyphen, the argument will be split on the hyphen and the resulting two values assigned to &amp;lt;code&amp;gt;MW_DB&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MW_PREFIX&amp;lt;/code&amp;gt;, respectively. For wikis by domain name:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wikis = [&lt;br /&gt;
    'wiki.iterativechaos.com' =&amp;gt; 'wiki',&lt;br /&gt;
    'mw.iterativechaos.com' =&amp;gt; 'mediawiki',&lt;br /&gt;
];&lt;br /&gt;
if ( defined( 'MW_DB' ) ) {&lt;br /&gt;
    // Automatically set from --wiki option to maintenance scripts&lt;br /&gt;
    $wikiID = MW_DB;&lt;br /&gt;
} else {&lt;br /&gt;
    // Use MW_DB environment variable or map the domain name&lt;br /&gt;
    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;&lt;br /&gt;
    if ( !$wikiID ) {&lt;br /&gt;
        die( 'Unknown wiki.' );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$wgLocalDatabases = $wgConf-&amp;gt;wikis = array_values( $wikis );&lt;br /&gt;
$wgDBname = $wikiID;&lt;br /&gt;
$wgDBuser = 'mediawiki';&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Configure settings that must differ for all wikis. For example:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wgCacheDirectory = &amp;quot;/tmp/mediawiki_cache/$wgDBname&amp;quot;;&lt;br /&gt;
$wgUploadDirectory = &amp;quot;$IP/images/$wgDBname&amp;quot;;&lt;br /&gt;
$wgUploadPath = &amp;quot;/w/images/$wgDBname&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Configure per-wiki overrides. This should include at least {{phpi|$wgServer}} and {{phpi|$wgArticlePath}}.&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wgConf-&amp;gt;settings = [&lt;br /&gt;
    'wgServer' =&amp;gt; [&lt;br /&gt;
        'examplewiki' =&amp;gt; 'https://example.org',&lt;br /&gt;
        'onewiki' =&amp;gt; 'https://one.example.org',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgArticlePath' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; '/wiki',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgSitename' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; 'Example',&lt;br /&gt;
        'onewiki' =&amp;gt; 'One',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgLogo' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; '/images/examplewiki/Example_logo.png',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgLanguageCode' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; 'en',&lt;br /&gt;
        'onewiki' =&amp;gt; 'pt',&lt;br /&gt;
    ],&lt;br /&gt;
];&lt;br /&gt;
extract( $wgConf-&amp;gt;getAll( $wgDBname  ) );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This could be done from a separate file, e.g.:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
# LocalSettings.php&lt;br /&gt;
$wgConf-&amp;gt;settings = require __DIR__ . '/LocalSettings_overrides.php';&lt;br /&gt;
&lt;br /&gt;
# LocalSettings_overrides.php&lt;br /&gt;
return [&lt;br /&gt;
    'wgServer' =&amp;gt; ..,&lt;br /&gt;
    ..,&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a new wiki, create its database and add its settings first, and then run &amp;lt;code&amp;gt;php maintenance/update.php --wiki=mywiki&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Wiki farm ==&lt;br /&gt;
&lt;br /&gt;
The following steps are for running multiple wikis on same version of MediaWiki:&lt;br /&gt;
&lt;br /&gt;
# Install the first wiki as normal. For details, see Manual:Installation guide.&lt;br /&gt;
# Enable your web server to share your MediaWiki install with all wikis. For multiple (sub)domains, you can use listen on multiple server names. For multiple subdirectories, you could use rewrite rules, aliases, or symlinks.&lt;br /&gt;
# Add code to the top of &amp;lt;code&amp;gt;LocalSettings.php&amp;lt;/code&amp;gt;, to detect the current wiki. Note that if the argument to &amp;lt;code&amp;gt;--wiki&amp;lt;/code&amp;gt; contains a hyphen, the argument will be split on the hyphen and the resulting two values assigned to &amp;lt;code&amp;gt;MW_DB&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MW_PREFIX&amp;lt;/code&amp;gt;, respectively. For wikis by domain name:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wikis = [&lt;br /&gt;
    'example.org' =&amp;gt; 'examplewiki',&lt;br /&gt;
    'one.example.org' =&amp;gt; 'onewiki',&lt;br /&gt;
];&lt;br /&gt;
if ( defined( 'MW_DB' ) ) {&lt;br /&gt;
    // Automatically set from --wiki option to maintenance scripts&lt;br /&gt;
    $wikiID = MW_DB;&lt;br /&gt;
} else {&lt;br /&gt;
    // Use MW_DB environment variable or map the domain name&lt;br /&gt;
    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;&lt;br /&gt;
    if ( !$wikiID ) {&lt;br /&gt;
        die( 'Unknown wiki.' );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$wgLocalDatabases = $wgConf-&amp;gt;wikis = array_values( $wikis );&lt;br /&gt;
$wgDBname = $wikiID;&lt;br /&gt;
$wgDBuser = 'mediawiki';&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Configure settings that must differ for all wikis. For example:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wgCacheDirectory = &amp;quot;/tmp/mediawiki_cache/$wgDBname&amp;quot;;&lt;br /&gt;
$wgUploadDirectory = &amp;quot;$IP/images/$wgDBname&amp;quot;;&lt;br /&gt;
$wgUploadPath = &amp;quot;/w/images/$wgDBname&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Configure per-wiki overrides. This should include at least {{phpi|$wgServer}} and {{phpi|$wgArticlePath}}.&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wgConf-&amp;gt;settings = [&lt;br /&gt;
    'wgServer' =&amp;gt; [&lt;br /&gt;
        'examplewiki' =&amp;gt; 'https://example.org',&lt;br /&gt;
        'onewiki' =&amp;gt; 'https://one.example.org',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgArticlePath' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; '/wiki',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgSitename' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; 'Example',&lt;br /&gt;
        'onewiki' =&amp;gt; 'One',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgLogo' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; '/images/examplewiki/Example_logo.png',&lt;br /&gt;
    ],&lt;br /&gt;
    'wgLanguageCode' =&amp;gt; [&lt;br /&gt;
        'default' =&amp;gt; 'en',&lt;br /&gt;
        'onewiki' =&amp;gt; 'pt',&lt;br /&gt;
    ],&lt;br /&gt;
];&lt;br /&gt;
extract( $wgConf-&amp;gt;getAll( $wgDBname  ) );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;This could be done from a separate file, e.g.:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
# LocalSettings.php&lt;br /&gt;
$wgConf-&amp;gt;settings = require __DIR__ . '/LocalSettings_overrides.php';&lt;br /&gt;
&lt;br /&gt;
# LocalSettings_overrides.php&lt;br /&gt;
return [&lt;br /&gt;
    'wgServer' =&amp;gt; ..,&lt;br /&gt;
    ..,&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a new wiki, create its database and add its settings first, and then run &amp;lt;code&amp;gt;php maintenance/update.php --wiki=mywiki&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Separate settings files ==&lt;br /&gt;
&lt;br /&gt;
This approach is for operating entirely independent wikis, but still sharing the same web server and MediaWiki source code.&lt;br /&gt;
&lt;br /&gt;
# Install the first wiki as normal, via the web or CLI installer, which sets up your database and generates a LocalSettings.php file.&lt;br /&gt;
&lt;br /&gt;
# After installation, rename the generated &amp;lt;code&amp;gt;LocalSettings.php&amp;lt;/code&amp;gt; file to include the wiki ID (e.g. database name), like &amp;lt;code&amp;gt;LocalSettings_mywiki.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Repeat step one and two above for each wiki you wish to create.&lt;br /&gt;
&lt;br /&gt;
# Create a new &amp;lt;code&amp;gt;LocalSettings.php&amp;lt;/code&amp;gt; file that will load the correct one. As with the above wiki farm example, a &amp;lt;code&amp;gt;--wiki&amp;lt;/code&amp;gt; argument containing a hyphen will be split on the hyphen into two values assigned to &amp;lt;code&amp;gt;MW_DB&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MW_PREFIX&amp;lt;/code&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$wikis = [&lt;br /&gt;
    'example.org' =&amp;gt; 'examplewiki',&lt;br /&gt;
    'one.example.org' =&amp;gt; 'onewiki',&lt;br /&gt;
];&lt;br /&gt;
if ( defined( 'MW_DB' ) ) {&lt;br /&gt;
    // Automatically set from --wiki option to maintenance scripts&lt;br /&gt;
    $wikiID = MW_DB;&lt;br /&gt;
} else {&lt;br /&gt;
    // Use MW_DB environment variable or map the domain name&lt;br /&gt;
    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ( $wikiID ) {&lt;br /&gt;
    require_once &amp;quot;LocalSettings_$wikiID.php&amp;quot;;&lt;br /&gt;
} else {&lt;br /&gt;
    die( 'Unknown wiki.' );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Add any settings that should apply to all wikis below this line&lt;br /&gt;
// -------&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your wikis are on the same domain but under different paths (e.g. &amp;lt;code&amp;gt;example.org/wiki1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;example.org/wiki2&amp;lt;/code&amp;gt; etc.), you can use something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$wikis = [&lt;br /&gt;
    '/example' =&amp;gt; 'examplewiki',&lt;br /&gt;
    '/w_example' =&amp;gt; 'examplewiki',&lt;br /&gt;
    '/one' =&amp;gt; 'onewiki',&lt;br /&gt;
    '/w_one' =&amp;gt; 'onewiki',&lt;br /&gt;
];&lt;br /&gt;
if ( defined( 'MW_DB' ) ) {&lt;br /&gt;
    // Automatically set from --wiki option to maintenance scripts.&lt;br /&gt;
    $wikiID = MW_DB;&lt;br /&gt;
} else {&lt;br /&gt;
    $path = explode( '/', $_SERVER['REQUEST_URI'] ? '', 3 )[1] ?? '';&lt;br /&gt;
    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $path ] ?? null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ( $wikiID ) {&lt;br /&gt;
    require_once &amp;quot;LocalSettings_$wikiID.php&amp;quot;;&lt;br /&gt;
} else {&lt;br /&gt;
    die( 'Unknown wiki.' );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If you use [[Special:MyLanguage/Manual:Short URL|Short URL]], you need to add both your $wgArticlePath and the $wgScriptPath&lt;/div&gt;</summary>
		<author><name>RobertBushman</name></author>
	</entry>
</feed>