Become The Solution Chicago Logo

Become The Solution Chicago Logo

Search Become The Solution:

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!

4

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Guest
Friday, 19 July 2019


Sign-Up to Recieve E-Mail Updates!