1

I'm using the Hiawatha webserver and need to convert the following Apache URL rewrite rule into a URL toolkit rule.

RewriteRule ^symphony\/api(\/(.*\/?))?$ extensions/rest_api/handler.php?url=$1&%{QUERY_STRING} [NC,L]

%{QUERY_STRING} can't be used in Hiawatha's URL toolkit.

I've tried a few things, but my regex is poor.

Here's the basic Hiawatha URL rewrite format:

Match <originalurl> Rewrite <rewrittenurl>

An example URL that needs to be rewritten:

http://domain.co.uk/symphony/api/entries/photos/?auth-token=019ccc6e

Thanks.

David Oliver
  • 2,424
  • 1
  • 24
  • 37

1 Answers1

0

Just a guess, try

Match ^symphony\/api(\/(.*\/?))?\?(.*)$ Rewrite extensions/rest_api/handler.php?url=$1&$2
Match ^symphony\/api(\/(.*\/?))?$ Rewrite extensions/rest_api/handler.php?url=$1
Nils Werner
  • 34,832
  • 7
  • 76
  • 98
  • I found something similar on http://serverfault.com/questions/130866/clean-urls-on-hiawatha and adapted the solution a little bit. – Nils Werner May 02 '12 at 16:09
  • Thanks for taking a look Nils. That gives 'Page not found' and is rewritten to `/extensions/rest_api/handler.php?url=/entries/photos/&entries/photos/` – David Oliver May 02 '12 at 19:12
  • I just found that changing the $2 at the end of the first line to $3 seems to do the trick, and gives `/extensions/rest_api/handler.php?url=/entries/photos/&auth-token=xxxxxx`. The API still isn't working for me, but I think that's a different issue related to server config. Thanks! – David Oliver May 02 '12 at 19:21