Forum Discussion
Eireann78_19953
Nimbostratus
Aug 02, 2010404 Handler
Hi,
I need an irule which catches 404s returned from a server pool and re-directs to a friendly page.
when HTTP_RESPONSE {
if { [HTTP::status] == 404} {
HTTP::respond "http://www..test.com/pagenotfound"
}
}
My problem is the pagenotfound returns a 404 status code so it has created a loop.
Any advice on the best way to proceed I have done some searching but haven't found an irule which matches what I need to do.
Cheers.
- hoolio
Cirrostratus
As Chris said, the 404 handler page shouldn't return a 404 itself. Though if this is something you can to implement and you can't change the status, you could save the URI in HTTP_REQUEST and then not redirect to the 404 page if the request is for it already.when HTTP_REQUEST { set uri [HTTP::uri] } when HTTP_RESPONSE { if { [HTTP::status] == 404 and $uri ne "/404.html"} { HTTP::redirect "http://www.example.com/404.html" } }
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