Forum Discussion
warren_beaudry_
Nimbostratus
Jul 26, 2013irule to load custom page via ifile when HTTP::status !200
Good day, DevCentral is an incredible resource but I thought I throw out my specific scenario for the community's opinion.
We're looking to load a "friendly" page via ifile to send to the...
warren_beaudry_
Nimbostratus
Aug 02, 2013I ended up using html with the logo embedded so I could do it all in HTTP_RESPONSE.
I had an issue with it working in IE but not FF or Chrome; had to set the Content-Type header for it to work for all:
when HTTP_RESPONSE {
if { [HTTP::status] != "200"} {
switch [HTTP::status] {
"404" { HTTP::respond 200 -version 1.1 content [ifile get "/Common/404.html"] noserver "Content-Type" "text/html; charset=utf-8"
}
"503" { HTTP::respond 200 -version 1.1 content [ifile get "/Common/503.html"] noserver "Content-Type" "text/html; charset=utf-8"
}
default { HTTP::respond 200 -version 1.1 content [ifile get "/Common/unexpected.html"] noserver "Content-Type" "text/html; charset=utf-8"
}
}
}
}
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