To make your MediaWiki powered website SEO friendly, then follow the two steps provided below.
Step 1: Add code to htaccess file
- Go to your website's main folder
- Open .htaccess folder
- Copy and paste the following code
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?title=$1 [NC,L,QSA]
The code above removes index.php from Mediawiki CMS (Content Management Systems) web page urls, making them short and SEO friendly.
Step 2: Add code to LocalSettings.php file
- Go to LocalSettings.php and add the following code
$wgScript = "";
$wgArticlePath = "$wgScript$1";
Note: If you have installed MediaWiki in a public html folder for instance forum folder the replace line one of the code $wgScript = ""; with $wgScript = "/forum/";