Forum Discussion
pgsmith_120398
Apr 25, 2013Nimbostratus
I'm really not entirely sure why it wasn't working, however I finally got it working with the following code:
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
switch [string tolower [HTTP::uri]] {
"/" {
HTTP::respond 200 content [ifile get index.html] "Content-Type" "text/html"
}
"/ufstyle.css" {
HTTP::respond 200 content [ifile get ufstyle.css] "Content-Type" "text/css"
}
"/myuflheaderborder.jpg" {
HTTP::respond 200 content [ifile get myuflheaderborder.jpg] "Content-Type" "image/jpeg"
}
"/myuflheader_bg.jpg" {
HTTP::respond 200 content [ifile get myuflheader_bg.jpg] "Content-Type" "image/jpeg"
}
"/myuflheader.gif" {
HTTP::respond 200 content [ifile get myuflheader.gif] "Content-Type" "image/jpeg"
}
"/myufllogo.gif" {
HTTP::respond 200 content [ifile get myufllogo.gif] "Content-Type" "image/jpeg"
}
"/uflwordmark.gif" {
HTTP::respond 200 content [ifile get uflwordmark.gif] "Content-Type" "image/jpeg"
}
}
}
}
In my HTML file I removed the leading /images/ or /css/ so it just reads image.jpg or ufstyle.css. I then created ifiles with the exact same name that were used in the HTML file on the F5 and created irule files with the exact same names as the ifiles. After doing that it is all working as expected.