Forum Discussion
Replace HTTP status response in returned URI.
This is actually a pretty reasonable approach Nathan. You'd necessarily want a pre-crafted HTML page for each possible 50x status message, so listing them in a data group is a good idea. Minor typo though:
when HTTP_RESPONSE {
if { [HTTP::status] starts_with 5 } {
if { [class match [HTTP::status] equals 5xx_codes] } {
set redirect [class match -value [HTTP::status] equals 5xx_codes]
HTTP::redirect "http://serveraddress.com${redirect}"
} else {
no crafted HTML for this error message - better to just drop then
reject
}
}
}
Nothing major, but the data group would have returned, for example, "/error_500.html", which would have made the redirect URL look like this (notice the double forward slash):
http://serveraddress.com//error_500.html
You could also save yourself the potential hassle of a second server to host these error messages by hosting them locally on the BIG-IP and using iFiles to retrieve them.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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