RewriteEngine On
RewriteBase /
# Ignore if file exists
RewriteCond %{REQUEST_FILENAME} !-f
# Ignore if directory exists
RewriteCond %{REQUEST_FILENAME} !-d
# Redirect if old w short path
RewriteRule ^w/(.*)$ /$1 [R=301,L]
# Redirect if old wiki path
RewriteRule ^wiki/(.*)$ /$1 [R=301,L]
# Sitemap moved fix
RewriteRule ^sitemap.xml*$ mediawiki/sitemap.xml [L,QSA]
# Root path rewrite to main page
RewriteRule ^$ mediawiki/index.php [L,QSA]
# Root path plus anything rewrite to article
RewriteRule ^([^/]*)$ mediawiki/index.php?title=$1 [L,QSA]