On 4/24/06, Tels nospam-abuse@bloodgate.com wrote:
Moin,
On Monday 24 April 2006 20:16, a@kid wrote:
Try this ...
if you want users to type yourdomain.com/wiki/SomeArticle to get yourdomain.com/rootdirectory/index.php?title=SomeArticle
use RewriteRule ^wiki/(.*)$ rootdirectory/index.php?title=$1 [QSA]
This only works if wiki and rootdirectory are different. Otherwise,
yourdomain.com/wiki/index.php?title=SomeArticle
would also match and result in
yourdomain.com/wiki/index.php?title=index.php?title=SomeArticle
Thats why the rules with "-f" and "-d" are better, they catch non-files and non-directories and link them into the wiki path.
Actually if you pay careful attention to the way wikipedia is set up, it uses two directories:
yourdomain.com/wiki and yourdomain.com/w
Some urls generated by mediawiki use $wgArticlePath and some don't. For example
yourdomain.com/wiki/Article and yourdomain.com/w/index.php?title=Article&action=edit
Besides making the problem in rewriting that you point out easier, this also allows the use of different robots.txt files so that you can direct spiders like the google bot not to crawl down edit links and other places you don't want to them to go.
This is discussed somewhere on the mediwiki/meta site, but I'm too lazy to track it down, and leave it as an exercise for the reader.
-- Rick DeNatale
Visit the Project Mercury Wiki Site http://www.mercuryspacecraft.com/