Forum Discussion
craig_lee10_177
Nimbostratus
Jan 18, 2013irule 404 page
Hi
I am wondering if someone can point me in the right direction. Basically the below works fine when I try and go to a directory that doesn’t exists
when HTTP_RESPONSE {
i...
craig_lee10_177
Nimbostratus
Jan 23, 2013Thanks for your help guys this is what I used in the end
when HTTP_REQUEST {
log local0. "\HTTP::host\]\[HTTP::uri\]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
switch -glob [string tolower [HTTP::uri]] {
"*404/404/css/baselogin.css" {HTTP::respond 200 content [ifile get baselogin] "Content-Type" "text/css"}
"*404/404/images/icon_alert.gif" {HTTP::respond 200 content [ifile get icon_alert] "Content-Type" "image/gif"}
"*404/404/images/logo_percep_sm.gif" {HTTP::respond 200 content [ifile get percep_sm] "Content-Type" "image/gif"}
"*404/404/images/bkg_loginbody.gif" {HTTP::respond 200 content [ifile get bkg_loginbody]"Content-Type" "image/gif" }
"*404/404/images/bkg_loginbottom.gif" {HTTP::respond 200 content [ifile get bkg_loginbottom]"Content-Type" "image/gif" }
"*404/404/images/bkg_logintop.gif" {HTTP::respond 200 content [ifile get bkg_logintop]"Content-Type" "image/gif" }
"*404/404/images/bkg_logintop.gif" {HTTP::respond 200 content [ifile get bkg_splashbody]"Content-Type" "image/gif" }
}
}
when HTTP_RESPONSE {
if { [HTTP::status] == 404 } {
HTTP::respond 200 content [ifile get "main_index"] noserver "Content-Type" "text/html" }
}
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