Initial Configuration

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


This is what MediaWiki looks like when you first get started:-

The default URL shows the domain name / the installation directory (w) / the file index.php / and the current page Main_Page.

This can be changed to a 'Short URL'.

Short URL

To shorten the URL requires commands in the .htaccess file which match a configuration in the LocalSettings.php file.

Source: https://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_Title_--_.htaccess

The matching configuration in LocalSettings.php is:-

$wgScriptPath  = "/w";
$wgArticlePath = "/wiki/$1";

The result is a 'Short URL'.

This will suit most installations of MediaWiki, and is therefore most common - MediaWiki-based websites usually have /wiki/ in the URL.

If desired, the /wiki can also be removed from a URL. See Short URL for .wiki Domain.

Main Page Title

The Main Page URL typically looks like this:-

To remove the Main_Page title from the URL and just present the domain name, change the value of $wgMainPageIsDomainRoot from false, which is the default, to true.

Add this line to LocalSettings.php $wgMainPageIsDomainRoot='true';

My version looks like this:-

The result is a clean-looking URL when users browse to your Main Page.


Site Name

The Site Name is configured in LocalSettings.php using information supplied during installation.

When MediaWiki was being installed for this site I entered 'My Site Name' and that became the configuration in LocalSettings.php.

To display the site name of your choice just change the values of $wgSitename and $wgMetaNamespace in LocalSettings.php. Here is the configuration for this site:-


The name of the meta namespace (also known as the project namespace), used for pages regarding the wiki itself. If set to false, the value of $wgSitename is assumed. An alias for this namespace is "Project".

The configuration for mh370wiki.net is a bit clearer:-

$wgSitename = "mh370wiki";
$wgMetaNamespace = "MH370wiki";

The Site Name appears in other places, for example in the Search box:-


Tagline

The site Tagline is configured in LocalSettings.php.

Default configuration:-
## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [
	'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
	'tagline' => [
		"src" => "My Tagline",
		"width" => 117,
		"height" => 13
	],
	'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
];

To alter the Tagline, simply insert your own text at "src" => " ",