Forum Discussion
Editing iRule for Maintainance Page with image local in F5 Big-IP iFile
Hi Omran,
Apologies, I have updated the the iRule code in my original reply (I was referencing the $URI variable which I did not declare). This should hopefully be fixed now, Please try copying and pasting the iRule again.
Dear Michael,
Thank you for your support and thorough explanation; it has greatly enhanced my understanding of how to use iRule with iFile.
Initially, I encountered difficulties, likely due to my limited coding experience. However, your expertise and suggestions, combining it with AI, helped resolve the issue. below is the result
iRule
=============================================================
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0 } {
set uri [HTTP::uri]
switch -glob $uri {
"/iFiles/Blackboard-LOGO" {
HTTP::respond 200 content [ifile get "Blackboard-LOGO"] "Content-Type" "image/png" "Cache-Control" "no-cache" "Connection" "Close"
}
"/iFiles/PSAU-LOGO" {
HTTP::respond 200 content [ifile get "PSAU-LOGO"] "Content-Type" "image/png" "Cache-Control" "no-cache" "Connection" "Close"
}
default {
HTTP::respond 503 content [ifile get "BBApp-maintainance-page.html"] "Content-Type" "text/html" "Cache-Control" "no-cache" "Connection" "Close"
}
}
}
}
===================================================================
I sincerely appreciate your assistance.
Regards
Omran Mohamed
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