I need to redirect requests, and I try to use this rewriter:
<rewriter xmlns="http://marklogic.com/xdmp/rewriter">
<match-path matches="^/(\w+\.xqy)$">
<set-path>/subfolder/$1</set-path>
</match-path>
<dispatch/>
</rewriter>
URL: http://marklogic:9012/query.xqy
Script is placed under /subfolder/query.xqy
But it gives "page not found, 404" result.
I also tried to check what path is at the end using following:
<match-path matches="^.*(\w+\.xqy)$">
<set-path>$0</set-path>
<set-query-param name="test">/smth/$1</set-query-param>
</match-path>
and then I print $test, and it has "/smth/$1" value, although the following
<set-query-param name="test">$1</set-query-param>
gives "script.xqy" value.
Seems like a bug in Marklogic?!