Forum Discussion
JoeTheFifth
Altostratus
Mar 09, 2017Intercept status codes and redirect
I'm currently trying to find redirection mecanism based on status codes from server response.
scenario is: Check for 2 two consecutive 401 status codes plus a 302 then a 200 + string in the 200 statu...
Vijay_E
Cirrus
Mar 09, 2017Your condition is not easy to track. You can have multiple HTTP requests passing through the F5 in random order for multiple connections. Making a decision based on a sequence of HTTP status code in a single connection seems a bit complicated. I would recommend trying to make a decision based on a specific value in the HTTP request instead of tracking multiple status codes.
You should be able to do something like this for a simple redirect based on status code:
when HTTP_RESPONSE {
if { [HTTP::status] == 404 } {
HTTP::redirect "http://www.example.com/not_found.html"
}
}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