But Colin is right (as usual i would say :p), won’t you need to rewrite the url in the response too ? if that’s the case a stream profile is the best method to achieve this
The stream profile/filter only operates against the payload. So if you’ve added an HTTP profile to the VIP, and want to modify the path in the URI (part of the headers--not the payload), you should use nmenant’s example of HTTP::path.
If you need to rewrite the request and/or response payload, I’d suggest adding a blank stream profile to the VIP and an iRule to configure the stream filter. Here is an example of replacing a string in the response content:
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace IE with Apache, Windows with Linux
STREAM::expression "@IE@Apache@ @Windows@Linux@"
Enable the stream filter for this response only
STREAM::enable
}
}
You can find more information on the stream profile and related STREAM:: commands on AskF5 and the iRules wiki: