Forum Discussion
IheartF5_45022
Dec 10, 2013Nacreous
If you page 'breaks' when you get a redirect to a maintenance page for an includes-type object, then I suspect that it will 'break' when you get a 404. However to answer your actual question this should work;-
when RULE_INIT {
List of well known 'page' extensions
set static::l_ext [list "" "do" "htm" "html" "jsp" "asp" "aspx" "wml" "xhtml" "json" "cfm"]
}
when HTTP_REQUEST {
Save variable for possible later use in HTTP_RESPONSE
set request [HTTP::uri]
}
when HTTP_RESPONSE {
if {[HTTP::status] == 404 && [lsearch $static::l_ext [string tolower [getfield [URI::basename $request] "." 2]]] != -1 } {
HTTP::respond 302 noserver Location "http://mycomapny.com/sorry_404.htm"
return
}