On 05/01/2008, Roan Kattouw roan.kattouw@home.nl wrote:
Chris Hecker schreef:
Also, if the wiki was in a subdir, then all of the css/js stuff and images would also be there, right, so I'd have the same problem. Or are you saying use rewrite to put only the index.php?title= queries into a virtual subdir? It doesn't really matter, because I can't change that now, but I'm curious.
The point is that you redirect e.g. /wiki/Main_Page to /w/index.php?title=Main_Page . CSS/JS stuff is in /w/skins/ , and is not affected by the pretty URL stuff. You can easily set up this scheme in Apache by adding "Alias /wiki /w/index.php" (without the quotes) to httpd.conf. The disadvantages of redirecting /Main_Page to /index.php?title=Main_Page is that you have to write your RewriteRules well: you don't want "index.php?title=Main_Page" to be interpreted as a page name, resulting in an infinite loop. Also, you have to watch out for /api.php , /skins/ and /images . It's possible, but it's more trouble than it's worth.
I had to do something like this recently - a page at internal.foo.com/ that was supposed to have a wiki hanging off it at internal.foo.com/wiki - meaning the main page was internal.foo.com/wiki/Main_Page and *not* internal.foo,com/ itself. This URL arrangement was out of my hands, so I had to somehow make this thing work.
(Now they've discovered wikis are cool(tm) and are considering making internal.foo.com/ be the wiki Main_Page after all ...)
I eventually wrote some insanely complicated rewrite rules :-) They looked a bit like:
Everyone ends up with a twisty maze of little rewrite rules, all different, but you can do most of the awful things you may have to.
- d.