Forum Discussion
MrRichard
Nimbostratus
Aug 13, 2013How to create iRule to deliver an alternate page response other than 'page unavailable'
When we currently disable one of the virtual servers in our setup, we get an 'unable to display this page' message in the browser. Rather than this, we would like to display a maintenance page so tha...
Dan_Cox_24281
Nimbostratus
Aug 13, 2013Here's what we use on our public web sites. Stored the HTML and images in iFiles for use elsewhere.
when HTTP_REQUEST {
if {[active_members [LB::server pool]] < 1} {
switch [HTTP::uri] {
"/guardian_header.jpg" { HTTP::respond 200 content [ifile get "guardian_header_jpg"] }
"/guardian_logo.jpg" { HTTP::respond 200 content [ifile get "guardian_logo_jpg"] }
default { HTTP::respond 200 content [ifile get "maint_index_html"] }
}
}
}
Dan_Cox_24281
Nimbostratus
Aug 13, 2013I like going the iFile route mainly because our web developers here insist on writing their own maintenance page and they require background images, logos, and such. With iFiles I don't have to convert them to base64 and embed them in an iRule. But, if you don't need to serve up any images or large HTML files it would be simpler to just put the HTML directly in the iRule as suggested by Kevin below.
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