I set up a wiki for my sister-in-law about the rare genetic disease, Prader-Willi Syndrome. I used Mediawiki, which is quite impressive. The hardest part of the configuration was rewriting the URLs so that pwsnotes.com, www.pwsnotes.com, and pwsnotes.org would all point to www.pwsnotes.org. This improves cacheing and search order ranking, and also looks better. The following Apache .htaccess file did the trick:
# close the php security hole...
php_flag register_globals off
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .*pwsnotes\.com
RewriteRule ^(.*)$ http://www.pwsnotes.org/$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^pwsnotes\.org
RewriteRule ^(.*)$ http://www.pwsnotes.org/$1 [R=permanent,L]
# Rewrite wiki?xxx as index.php?xxx and stop
#RewriteRule ^wiki$ index.php [L]
# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/phpmyadmin/
RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
# Rewrite any article as index.php/article and stop
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
And here are the edits I make to the LocalSettings.php generated by the web-based installer:
$wgArticlePath = "/$1";
$wgDisableUploads = false;
$wgFileExtensions = array('png','jpg','jpeg','ogg','doc','xls','ppt','mp3','sxc','pdf' );
Post a Comment