Thomasvr
Jun 24, 2019Nimbostratus
Irule modify host, uri on response
Hello,
The scenario is that we have url that needs to be translated to another url. So this needs to be done at the request. And for the response the url needs to be translated back to its original url.
For the request this works and this is how we have done this.
when HTTP_REQUEST {
if { ([HTTP::host] equals "test.domain.be") } {
set uris [HTTP::uri]
set newuri "/test[string range [string tolower [HTTP::uri]] 0 end]"
HTTP::uri $newuri
HTTP::host "test.newdomain.be"
}
}
So the user gives in a url. for example: test.domain.be/abc. We translate this into: test.newdomain.be/test/abc. So there is uri and host translation.
How can we do this for the response? So everything what we did here but then in reverse?