Dayton_Gray_103
Dec 15, 2008Nimbostratus
404 question
I am trying to send a redirect to a 404 page but also return a 404 status code to the web browser. How is this accomplished? I have the following iRule, but it only returns a blank page:
when HTTP_REQUEST {
if { [HTTP::uri] contains "notfound.jsp" } {
event disable all
}
}
when HTTP_RESPONSE {
if { [HTTP::status] == "404" or [HTTP::status] == "500"}{
log local0. "A 404 was hit"
HTTP::respond 404 Location "http://www.validdomainhere.com/error/notfound.jsp"
}
}
I would rather not host the content on the BigIP, so I'm hoping to redirect to a valid page but keep the 404 error code.
Thanks!