Forum Discussion
IainThomson85_1
Cumulonimbus
Nov 18, 2013Replace HTTP status response in returned URI.
Good Afternoon!
I've got hopefully what will be a very simple answer. On a response of HTTP 5XX (Where X is a variable), I want to redirect the traffic to SERVERADDRESS.com/error_5XX.html
...
nathe
Cirrocumulus
Nov 18, 2013Iain,
My iRule-foo isn't bad but I wouldn't class myself as an expert. Here's my thoughts.
Create a datagroup as follows:
5xx_codes {
"500" := "/error_500.html",
"501" := "/error_501.html"
}
And then an irule like this:
when HTTP_RESPONSE {
if {[HTTP::status] eq 5*} {
set redirect [class match -value [HTTP::status] equals 5xx_codes]
HTTP::redirect "http://serveraddress.com/$redirect"
}
}
This will replace the URI with the relevant one from the datagroup.
Not tested I'm afraid and only a quick, first attempt. Some better iRules than me might be able to improve/correct or even dismiss this attempt 😉
N
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