Manual:Short URL/Sturmkrieg

From mediawiki.org

This method of creating short URLs is very simple and uses minimal code. It is also very easy to implement. This has been developed for Apache webservers.

Source[edit]

LocalSettings.php[edit]

# Short URLs
$wgScriptPath       = "";
$wgScript           = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";
$wgArticlePath      = "$wgScriptPath/$1";
$wgUsePathInfo      = true;

.htaccess[edit]

# Š Copyright 2012 Mark A. Hershberger 
# http://www.mediawiki.org/wiki/User:MarkAHershberger
# CC BY-SA
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]