Forum Discussion
TMcGov_92811
Nimbostratus
Dec 04, 2009iRule for LTM to send HTTP Error code
Hello, I have a simple iRule that directs HTTP requests to certain pools based on the URI. If there is a URI that is not specified in the iRule, I would like the LTM to respond with an HTTP Error code...
L4L7_53191
Nimbostratus
Dec 04, 2009Use the HTTP_RESPONSE event to capture the errors you care about - from the docs (http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP_RESPONSE.html) they have an example and links to tons of others:
when HTTP_RESPONSE {
if { [HTTP::status] contains "404"} {
HTTP::redirect "http://www.siterequest.com/"
}
}
You could easily capture that error code and HTTP::retry against it, redirect it, serve back your own page, etc. - the sky is the limit!
-Matt
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
