How To: MediaWiki Enable SEO Friendly URLs Remove Index.php

How To: MediaWiki Enable SEO Friendly URLs Remove Index.php
Enabling SEO Url’s in MediaWiki is simple. This guide will walk you through doing so in an Apache webserver configuration.

1. Open LocalSettings.php located in your media wiki document root.

2. Add the following lines of code:





$wgArticlePath = "/$1"; 
$wgUsePathInfo = true;
$wgGenerateThumbnailOnParse = false;

3. Create a .htaccess file. Simply create a new text file and name it so. It might be hidden after you create it so ensure you enabled “show hidden files” in your appreciate Operating System (Mac/Windows).

4. Add the following rule codes into your new .htaccess file:

# Create Short URLs
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?title=$1 [NC,L,QSA]
# END Create Short URLs

5. Test your site links. All links should now appear as sitename/link/topic:article


Enjoy!

* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments 2

Guest - Wiki Turk Binge on Friday, 21 July 2023 18:47

thank you it worked and easy way

thank you it worked and easy way
Guest - Manuel Mora Escobedo on Monday, 20 February 2023 10:53

Thank you my friend this helps so much to me and so easy!!!!!

Thank you my friend this helps so much to me and so easy!!!!!
Wednesday, 19 June 2024