Forum Discussion
LTM Maintenance page
Hello everyone. Newbie here wanting more info on iRules and Maintenace Pages. I have my maintenance page working for whenever I go to site.inside.local, but when I try to get any other page to redirect below that site ie. site.inside.local/test/index.html, just gives me a page not found instead of my maintenance page. How can I fix in my iRule below? If I left something out, please let me know so I can clarify. Thanks in advance.
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
switch [string tolower [HTTP::uri]] {
"/" {
HTTP::respond 200 content [ifile get maint_html] "Content-Type" "text/html"
}
"/logo.jpg" {
HTTP::respond 200 content [ifile get logo_jpg] "Content-Type" "image/jpeg"
}
}
}
}
Geron
8 Replies
- What_Lies_Bene1
Cirrostratus
I think a third switch case is required to cover everything else;
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1} { switch [string tolower [HTTP::uri]] { "/" { HTTP::respond 200 content [ifile get maint_html] "Content-Type" "text/html" } "/logo.jpg" { HTTP::respond 200 content [ifile get logo_jpg] "Content-Type" "image/jpeg" } default { HTTP::respond 200 content [ifile get maint_html] "Content-Type" "text/html" } } } } - Geron_149833
Nimbostratus
So the default worked, but it didn't load my logo. How do I add it too?
- What_Lies_Bene1
Cirrostratus
Hmmm, well, you'll send the HTML on the first request and the browser should then read that and request the logo graphic subsequently. Can't see why it wouldn't.
- Geron_149833
Nimbostratus
It works fine if I do site.inside.local/. both HTML and logo load.
When I do site.inside.local/test/test.html just the HTML loads now because you told me about the default part. Before I had the default part this would just say page can't be found.
- Geron_149833
Nimbostratus
When I right click on the image on the maintenance page on the subdirectories, it thinks that the image is supposed to be in site.inside.local/test/logo.jpg instead of the root.
- What_Lies_Bene1
Cirrostratus
Ahh, so, can you change the HTML to use an absolute URL rather than a relative one. So
rather than just/logo.jpg
.logo.jpg - Geron_149833
Nimbostratus
SWEET!!! Worked like a CHAMP! Thank you VERY much.
- What_Lies_Bene1
Cirrostratus
Great. You're welcome.
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