Forum Discussion
Jboswell_33438
Nimbostratus
Oct 29, 2015How do I add html content and an ifile in the same maintenance page irule?
Sorry about such a seemingly simple question but I'm new to this and I am struggling trying to make it work. I have no problem displaying either HTML or an image but I can't get both to display at the same time. I want the HTML on top and the image beneath. In my example below, where would I place the RES variable to get the image to show along with the MTC_Content for html.
when HTTP_REQUEST { set RES [ifile get resoutage] set MTC_Content { Maintenance
`
Insert content here.....
..........
...........
`
"
}
HTTP::respond 200 content $MTC_Content
}
1 Reply
- Stanislas_Piro2
Cumulonimbus
try this kind of irule:
when HTTP_REQUEST { switch [HTTP::path] { "/maintenance/logo.png" { HTTP::respond 200 content [ifile get "logo.png"] "Content-Type" "image/png" return } "/maintenance/maintenance.html" { HTTP::respond 200 content [ifile get "maintenance.html"] "Content-Type" "text/html" return } default { set dpool [LB::server pool] if { [active_members $dpool] == 0 } { HTTP::redirect "/maintenance/maintenance.html"; unset dpool; return} unset dpool } } }
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