HTTP:host in HTTP_RESPONSE
Just attempting to update an HTTP_RESPONSE iRule to include a HTTP:host as well as it currently covers too much of the pool it is applied to.
According to https://devcentral.f5.com/wiki/iRul...PONSE.ashx I can use HTTP::host and according to https://devcentral.f5.com/wiki/iRules.HTTP__host.ashx I can use it against HTTP_RESPONSE.
When I try and implement it though I get an error stating:
[command is not valid in current event context (HTTP_RESPONSE)] [HTTP::host]
when HTTP_RESPONSE {
if { ( [HTTP::host] equals "example.com" ) and ( [HTTP::status] == 404 ) } {
HTTP::redirect "http://example.com/error.jpg"
}
}
The reason I am checking the host is multiple host headers are on the same virtual server and I only want to apply this redirect to 404s on the one host.
Is the wiki wrong or is it my implementation?
Many thanks,
Dan