Forum Discussion
fubarSUSHI
Altocumulus
Mar 12, 2014Maintenance page per status code received
Im trying to find an iRule that can do a maintenance page depending on what status code is given... for example:
status code 3xx - go to maintenance page 1 - "Your request has been redirected"...
Moe_Jartin
Cirrus
Mar 12, 2014So your irule will work as-is for when there are no servers available. Now you need to look at the responses when there ARE servers and intercept/replace that response. So just add this to the bottom of your iRule.
when HTTP_RESPONSE {
switch [HTTP::status] {
"3*" {
HTTP::respond 200 content "Your 3xx content here"
}
"4*" {
HTTP::respond 200 content "Your 4xx content here"
}
"5*" {
HTTP::respond 200 contetn "Your 5xx content here"
}
}
}
This is very basic and there could certainly be some further error checking, logging, and handling done if needed. This will give you a start though.
Joe
- fubarSUSHIMar 12, 2014
Altocumulus
Wow... thanks. Ill have to check this out and see if it works!
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