Forum Discussion
Ben_Wilson_2412
Cirrus
Jul 11, 2013Changing HTTP Reponse status code
Hi,
I've been asked to change the reponse HTTP Status code for custom 404 pages to "404" instead of 200.
It looks like this is possible by checking if the request is for /404.jsp, capturing...
Ben_Wilson_2412
Cirrus
Jul 12, 2013Posted By nitass on 07/11/2013 11:02 PM
when HTTP_RESPONSE {
if { [HTTP::status] == "404" or [HTTP::status] == "501" }{
HTTP::redirect "/error/404.jsp"
}
} so, does this work?
by the way, have you ever tried HTTP::retry instead of HTTP::redirect? so, client does not need to send another request (i.e. /error/404.jsp).
HTTP::retry
https://devcentral.f5.com/wiki/irules.http__retry.ashx
It works in that the client is sent a 302 to the error page.
The condition I'm looking to modify is the subsequent request the client will make for the /error/404.jsp page.
We want the HTTP Status for this request to be 404.
Thanks!
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
