Forum Discussion
Dayton_Gray_103
Nimbostratus
Oct 29, 2008Custom 404 passthrough question.
I have the following iRule in place:
when HTTP_REQUEST {
if { [HTTP::uri] contains "pagenotfound.html" } {
event disable all
}
}
when HTTP_RESPONSE {
if { [HTTP::statu...
Dayton_Gray_103
Nimbostratus
Nov 11, 2008I think I've found a solution, but I wanted to see if there are other ideas on how to do it, or if this seems at all silly:
when CLIENT_ACCEPTED {
set retries 0
}
when HTTP_REQUEST {
set request [HTTP::request]
}
when LB_SELECTED {
if { $retries >= 1 } {
LB::reselect pool server_404
}
}
when HTTP_RESPONSE {
if { [HTTP::status] == "404" or [HTTP::status] == "500" } {
incr retries
HTTP::retry $request
}
}
I can then use apache (which is the only member in the server_404 pool) to do a pass through redirect. This is needed to allow the browser to retain the original URI and not display /error/404.html:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/error/404.html
RewriteRule ^/.*$ /error/404.html [PT,L]
Thoughts? Is there a way to eliminate the Apache rewrite altogether?
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