Forum Discussion
JRahm
Aug 13, 2013Admin
that assumes of course you have a my404page page defined to respond. You could define this in an iRule by uploading the source to an iFile (named my404page_html in this example) and then respond to requests with it:
when HTTP_REQUEST {
set host [HTTP::host]
set path [HTTP::path]
switch $path {
"/my404page" {
HTTP::respond 200 content [ifile get "my404page_html"]
}
}
}
when HTTP_RESPONSE {
if { [HTTP::status] eq "404" } { HTTP::redirect "https://${host}/my404page?url=${path}" }
}