Forum

Wacko Wiki URLToolkit suntax

Phil Daintree
21 June 2009, 04:07
Hi Hugo,

I am trying to get wacko wiki

http://wackowiki.org/Doc/English

going with hiawatha using URL re-writing - I do struggle with this area!!
However on this occasion with the help of

#wigwam -t wacko

where wacko is the ToolkitID I defined in httpd.conf to test the URLs returned by the toolkit I think I have cracked it.

Hiawatha version: 6.14
Operating System: puppylinux 4.2.1

The apache .htaccess file is:
<IfModule mod_rewrite.c>

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(robots\.txt)$ robots.txt [L]
RewriteRule ^(sitemap\.xml)$ sitemap.xml [L]
RewriteRule ^(favicon\.ico)$ favicon.ico [L]
RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]

</IfModule>


The wacko installation is under localhost/wacko - or the full filepath of /root/httpd/hiawatha/wacko

I've looked through the examples and the new HOWTO for URL re-writing and had a crack with the following:

UrlToolkit {
ToolkitID = wacko
Match ^/$ Return
RequestURI isfile Exit
Match /wacko/(.*)\?(.*) Rewrite /wacko/index.php?page=$1&$2
Match /wacko/(.*) Rewrite /wacko/index.php?page=$1
}



Subject to your review - this maybe helpful for other folks who wish to install wacko wiki under hiawatha

I notice that you can only use a Toolkit under the virtual host section, it might be nice to allow UseToolkit under the Directory - since this rule should not be applied to other directories. I may not be understanding something though here!

Thanks again for your patience and support

Phil
Hugo Leisink
21 June 2009, 11:07
I don't have experience with Wacko wiki, but the rewrite rules look logical. I'll try Wacko wiki myself tonight and if the those rules are indeed correct, I'll add them to my HOWTO page. Thanks.

About rewrite rules for a certain directory, you can use directory filters inside the rule inside a rule by using Goto. This is done in this example:
UrlToolkit {
ToolkitID = some_rule
Match ^/directory/.* Goto directory_rule
}

UrlToolkitID {
ToolkitID = directory_rule
RequestURI isfile Exit
Match ^/directory/downloads/(.*) Rewrite /directory/download.php?file=$1
...
}

I've been thinking about allowing UseToolkit for a Directory block, but then you have part of the toolkit logica outside the toolkit. So, I decided to create things like Goto and Call to have the same functionality, but then all in one location.
Hugo Leisink
23 June 2009, 02:35
I've been trying to get this WackoWiki running, but it gives me nothing but errors. I guess WackoWiki is indeed a correct name for it.....
This topic has been closed.