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:
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).
5. Test your site links. All links should now appear as sitename/link/topic:article
$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.*
Comments 2
thank you it worked and easy way
Thank you my friend this helps so much to me and so easy!!!!!