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...
Kevin_Stewart
Employee
Jul 12, 2013I believe you should also be able to use strictly HTTP events:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/error/test.jsp" } {
set is404 1
}
}
when HTTP_RESPONSE {
if { [info exists is404] } {
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_RESPONSE_DATA {
HTTP::respond 404 content [HTTP::payload]
}
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
