rewriter
Description
Rewrites the path of incoming requests based on a mapping or redirects requests.
Can be used in
spring:beans, api, bean, if, interceptor, internalProxy, proxy, registration, request, response, serviceProxy, soapProxy, stompProxy, swaggerProxy, transport and wsStompReassembler
Syntax
<rewriter> <map from="..." to="..." do="..." >* </rewriter>
Sample
The first mapping in the example below shows a simple mapping from the path /home to /index.
In the second mapping a regexp group captures everything after /bank/. The $1 in the rewritten URI will be substituted with the content of the captured group.
In the third mapping, a group captures everything after /search/ and redirects the user to some example search portal searching for the content of the group.
<serviceProxy port="80"> <rewriter> <map from="^/home" to="/index" /> <map from="^/bank/(.*)" to="/axis2/$1" /> <map from="^/search/(.*)" to="http://www.example.com/search?q=$1" do="redirect" /> </rewriter> </serviceProxy>
Child Elements
Position | Cardinality | Description | Element |
---|---|---|---|
1 | 1..* | Defines a regex and a replacement for the rewriting of the URI. | map |