Mediawiki rewrite rules

From Wiki2
Revision as of 14:28, 31 December 2013 by Tim (talk | contribs)

mediawiki rewrite rules

if you want a setup like http://wiki.sitebuilt.net/Tobin ...

1. create subdomain in /etc/sites-available as in these directions

2. got0 http://shorturls.redwerks.org/ and follow the directions which ends up with in /etc/sites-available/wiki add

   RewriteEngine On
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
   RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/wiki/index.php [L]
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
   RewriteRule ^/?wiki/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/wiki/thumb.php?f=$1&width=$2 [L,QSA,B]
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
   RewriteRule ^/?wiki/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/wiki/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

and at the bottom of localsettings.php add

 $wgScriptPath = "/wiki";
 $wgScriptExtension = ".php";
 $wgArticlePath = "/$1";