Forum

UrlToolkit

Remco
24 February 2009, 21:51
Hello/Hallo!

I have problem with the UrlToolKit. When I have this included in my configfile, running Hiawatha fails ALWAYS on the first line after the {. Why is this? Does a urltoolkit has a special place in the httpd.conf file? Do I have to enable it explicitly?

UrlToolkit {
ToolkitID = default
RequestURI isfile Return
Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
Match .*\?(.*) Rewrite /index.php?$1
Match ^/.* Rewrite /index.php
}


h1327387:/etc/hiawatha # hiawatha
Syntax error in httpd.conf on line 119.


I grabbed this example from the wiki, but with other urltoolkit's I've the same problem. In the httpd.config there's n URLRewrite section. Do I have to use this instead of the documented UrlToolKit? (I can't find any URLRewrite documentation).

I run hiawatha on an OpenSuse 11.1 box. Without the URLToolKit everything seems to be ok (php runs correctly via fast-cgi).
Hiawatha is compiled with the following options:
h1327387:/var/log/hiawatha # hiawatha -v
Hiawatha v6.7, cache, CommandChannel, IPv6, SSL, URL rewrite


I hope there's someone out there with an answer.
Many thanks in return.

Remco
Hugo Leisink
24 February 2009, 22:01
UrlRewrite config style is used in Hiawatha 6.7 and earlier. After 6.7, I switched to UrlToolkit. It's all explained on this page [www.hiawatha-webserver.org].

My advice is to upgrade to the latest release (6.11 at the moment of writing).
Remco
25 February 2009, 12:20
Thanks for your quick reply. I installed it from the OpenSuse RPM (downloadable here). I did not notice that this was an old version. I upgraded it. However, I still have a problem.

When I consider this rule
Match ^(.*)/(.*?)$ Rewrite /test.php?url=$2&dir=$1


when i go to mysite.com/x/y/z/a/b/c/

I want the x under $1 and y/z/a/b/c under $2. Is this possible? With this condition I get it all under $1.
Is it possible? Do I have to change the regexp?
Hugo Leisink
25 February 2009, 14:02
Yes, you have to change your regexp. You have to do more with the question mark (.*?). In an hour, I'm leaving for holiday, so I haven't time to test some regexps myself. I'll help you more when I get back. Sorry.
This topic has been closed.