[Mediawiki-l] Short URL reflecting wiki structure, no www

Roger Chrisman roger at rogerchrisman.com
Thu Aug 9 00:02:58 UTC 2007

Short URLs work for my http://wikigogy.org wiki

* http://www.mediawiki.org/wiki/Manual:Short_URL
* http://www.mediawiki.org/wiki/Manual:Wiki_in_site_root_directory
* http://www.mediawiki.org/wiki/Manual:Flat_namespace
* http://www.mediawiki.org/wiki/Help:Subpages
* http://www.mediawiki.org/wiki/Help:Categories

As for file or directory names  coexisting with the wiki namespace (root 
dir of your wiki as root dir of your site), that is handled fine for me 
by this part of my .htaccess that prevents my wiki from interfering 
with real files (!-f) and directories (!-d) that happen to be in my 
website root dir (eg mysite.com/here):

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

For the curious, my full .htaccess looks like this:

#MediaWiki requries PHP5, so:
AddHandler application/x-httpd-php5 .php
Options FollowSymLinks
RewriteEngine On
# Dreamhost stuff
# prevent your Dreamhost /stats from breaking
# (see http://wiki.dreamhost.com/index.php/Mod_rewrite)
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
# end of Dreamhost stuff
# Short URLs stuff:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Use this one if you are using *ugly URLs* -- PHP as CGI:
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
# Use this one if you are using *pretty URLs* -- PHP as Apache module:
#RewriteRule ^(.+)$ /index.php/$1 [L,QSA]

I don't host it at Dreamhost anymore because of server slowdowns there. 
My wiki is now snappy at Dathorn.com. They don't overcrowd servers. But 
I've left those Dreamhost details there for folks who may find them 

My wiki running above .htacces is http://wikigogy.org

If anyone is aware of SECURITY ISSUES I have created by running my wiki 
in the root of my site (it is a wiki only site so I like it there), 
please comment on:

* http://www.mediawiki.org/wiki/Manual:Wiki_in_site_root_directory



More information about the MediaWiki-l mailing list