Forum Discussion
JRahm
Mar 05, 2014Admin
iFiles have two places of configuration, adding the file itself to the system (System->File Management->iFile List) and then making it accessible to an iRule (Local Traffic->iRules->iFile List). If you only use one partition, you can don't need the folder reference on your iFile call. My iRule for serving up html pages (with css/js and images) looks like this:
when HTTP_REQUEST {
if { [active_members appPool1] == 0 } {
HTTP::respond 200 content [ifile get "mtce_html"] "Content-Type" "text/html"
}
switch $path {
"/css/mtce.css" {
HTTP::respond 200 content [ifile get "mtce_css"] "Content-Type" "text/css"
return
}
"/img/mtce.png" {
HTTP::respond 200 content [ifile get "mtce_img"] "Content-Type" "image/png"
return
}
"/js/mtce.js" {
HTTP::respond 200 content [ifile get "mtce_js"] "Content-Type" "text/javascript"
return
}
}
}