Forum Discussion
Moinul_Rony
Altostratus
Dec 09, 2013how to ignore internal 404 response and only activate a irule on a full page 404 response ( such as css, image etc. )
Hi,
Just for a background I have a irule to catch 4xx and 5xx response and do a generic html response and redirect to maintenance/homepage.
All was working good until some pages had intern...
Kevin_Stewart
Employee
Dec 09, 2013You could go either I think, but you'd more or less have to define all page objects or all non-page objects, or at least object extensions. Here's an example that defines non-page objects from a data group.
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] ends_with objectlist] } {
set do_not_err 1
}
}
when HTTP_RESPONSE {
if { [info exists do_not_err] } {
unset do_not_err
return
} elseif { ( [HTTP::status] starts_with "40" ) or ( [HTTP::status] starts_with "50" ) } {
HTTP::respond 200 content "Broken"
}
}
where objectlist is a string-based data group that contains the lowercased extensions of known object types that you might encounter on a page. Example.
jpg
gif
png
js
css
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