Without rebuilding your entire iRule, the logic for such a requirements might look like this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/uri" } {
set noerror 1
}
}
when HTTP_RESPONSE {
if { ( ( [HTTP::status] starts_with "4" ) or ( [HTTP::status] starts_with "5" ) ) and not ( [info exists noerror] ) } {
HTTP::respond 200 content "..."
}
}
This will set a variable in the HTTP_REQUEST event if a specific URI is requested, which will be visible in the corresponding HTTP_RESPONSE event. If users might flip between applications in a single connection, you can optionally add the following to the bottom of the HTTP_RESPONSE event to clear the variable between requests if it exists:
if { [info exists noerror] } { unset noerror }