Skip to content

Instantly share code, notes, and snippets.

@debloper
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debloper/9103860 to your computer and use it in GitHub Desktop.
Save debloper/9103860 to your computer and use it in GitHub Desktop.
Script examples for regular server deployments

Short URLs in MediaWiki

Settings for mediawiki running on Apache server, with clean URLs like domain.tld/Article_Name, when the installation directory is %{DOCUMENT_ROOT}/w/

The Contents of the .htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?(.*)$ %{DOCUMENT_ROOT}/w/index.php/$1 [L,QSA]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L,QSA]

Modifications in LocalSettings.php file:

$wgScriptPath = "/w";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;
$wgScriptExtension = ".php";

That's about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment