Skip to content

Instantly share code, notes, and snippets.

@daanraman
Created April 2, 2015 15:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daanraman/af19d0b7f8fefdbc49a4 to your computer and use it in GitHub Desktop.
Save daanraman/af19d0b7f8fefdbc49a4 to your computer and use it in GitHub Desktop.
Shorter and beautiful URL's in Mediawiki (and removing index.php)
.htaccess:
----------
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]
LocalSettings.php:
------------------
## Added by Daan Raman - shorter URLs and removing index.php
$wgArticlePath = "{$wgScriptPath}/$1";
$wgUsePathInfo = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment