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 24, 2009Hi Mike,
It sounded like you wanted to change the 200 status to a 400. But your test rule is trying to rewrite a redirect (which would be a 30x status) to a 404. Can you use a browser plugin like HttpFox for Firefox or Fiddler for IE to determine exactly what the application is sending back and then describe what you want to do with it?
Unfortunately, HTTP::status can only be used to get (not set) the status of the response. So to "change" the status you could need to send your own response using HTTP::respond. It's fairly simple if you can send your own response content. Or if you need to leave the response data from the server in tact, you'd need to collect the payload for the specific responses and then use HTTP::respond to send a 404 response with the original payload. You can check the HTTP::collect wiki page (Click here) for examples.
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