I missed that you were needing to rewrite the host at the same time. Like kirkbauer noted, you can use the proxypass rule for multiple rewrites. Else for one-off changes to both the host and URI, here are updates for the examples I gave above...
You can use 'string map' (
Click here) to rewrite /maps.asp to /VoucherMap.aspx within the complete URI and/or Host header strings.
You can rewrite the requested host and URI before the request is sent to the node with something like this:
when HTTP_REQUEST {
HTTP::header replace Host [string map {oldhost newhost} [string tolower [HTTP::host]]]
HTTP::uri [string map {/maps.asp /VoucherMap.aspx} [HTTP::uri]]
}
Else, if you do want to redirect the client to the new URI, you can use
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/maps"}{
HTTP::redirect "http://[string map {oldhost/maps.asp newhost/VoucherMap.aspx} [string tolower[HTTP::host]][HTTP::uri]]"
}
}
If the web app is sending a 302 redirect, you can check in the HTTP_RESPONSE for a 30x response code and then look in the Location header for /maps and rewrite it to /VoucherMap.aspx.
Lastly, if the web application isn't case sensitive for the URI, you should set the URI to lowercase before making comparisons. I used string tolower to do this for the host header value, as that is not case sensitive for any web app.
Aaron