Forum Discussion
Dan_Brown_19294
Nimbostratus
Mar 12, 2012HTTP:host in HTTP_RESPONSE
Hi all, 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://devc...
koenning_107182
Nimbostratus
Mar 12, 2012Hi Dan,
looking into the standard, Host seems to be a request header only, see
http://www.ietf.org/rfc/rfc2616.txt , e.g. p127 14.23
so this makes sense. Will double-check with a colleague, and then update the wiki
However, use the following to achieve your goal:
when HTTP_REQUEST {
set my_host_header [HTTP::host]
}
when HTTP_RESPONSE {
if { ( $my_host_header equals "example.com" ) and ( [HTTP::status] == 404 ) } {
HTTP::redirect "http://example.com/error.jpg"
}
}
Cheers,
Christian
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects