Forum

Need Help With URL Rewriting

moltkestr19
19 July 2010, 03:28
First of all, congratulations to a decent and very secure web server.

I am new to Hiawatha and have a problem with my following (simple) apache rewrite rule

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*/$ index.php?__route__=$1 [L,QSA]


Quite simple right? not for me. Here is what I've done so far translating it to Hiawatha URL rewriting configuration

UrlToolkit {
ToolkitID = foobar
RequestURI isfile Exit
RequestURI isdir Exit
Match ^/(.*)\?*/$ Rewrite /index.php?__route__=$1
}


It works somehow partially

e.g for :
http://foo.bar/test/

but not e.g for:
http://foo/bar/test/?foo=bar
http://foo/bar/test/?foo=bar&baz=blah

I'm quite desperate here. Any help will be of course highly appreciated. Thanks.

Regards,
Moltkestr19

Hiawatha version: 7.3
Operating System: Ubuntu Server 10.4
Hugo Leisink
19 July 2010, 07:57
To handle URL parameters, you need a UrlToolkit rule like this:
UrlToolkit {
ToolkitID = foobar
RequestURI exists Exit
Match ^/(.*)\?(.*) Rewrite /index.php?__route__=$1&$2
Match ^/(.*) Rewrite /index.php?__route__=$1
}
This topic has been closed.