Forum Discussion
Mike_86382
Altostratus
Apr 23, 2009A twist on the 404 status code
Hello. I am new to iRules, but I have an important task to accomplish:
I need to rewrite an http response status code from 200 to 404 whenever a particular page is sent to the client. W...
hoolio
Cirrostratus
Apr 28, 2009Something like this should work for this:
when HTTP_RESPONSE {
Check if response is a redirect and the Location header contains the 404 page
if { [HTTP::is_redirect] and [HTTP::header Location] contains "http://www.mydomain.com/404.htm"}{
Send a 404 with custom content
HTTP::respond 404 content {
Custom 404
All this content comes from our real 404.htm page, but is manually copied into here.
}
}
}
Aaron
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