rewriter
Rewrites the path of incoming requests based on a mapping.
Can be used in
proxy, soapProxy, serviceProxy, transport
Syntax
<rewriter> <map from="..." to="..." do="..." >* </rewriter>
Listing 1: rewriter Syntax
Sample
The first mapping in the example below shows a simple mapping from the path /home to the path /index.
In the second mapping a 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>
Listing 2: rewriter Example
Child Elements
Name | Cardinality | Description |
---|---|---|
map | 0..* | Defines a regex and a replacement for the rewriting of the URI. |