August 9, 20169 yr We would like to redirect 400 and 500 html errors to a specific page using iRules as well as set cache control for webserver static contents like CSS, JavaScript, images. Could you help suggest an iRule for this?
August 9, 20169 yr Not sure but the following may help you out with the error redirects when HTTP_RESPONSE { if { [HTTP::status] equals "403" or [HTTP::status] equals "401" } { HTTP::redirect "/autherror.html" } } For the cache control portion of your request, the following may work: when HTTP_RESPONSE { if {[class match [HTTP::header Content-Type] equals smartcash_static_content_types_class]}{ HTTP::header replace "Cache-Control" "private, max-age=604800" } else { HTTP::header replace "Cache-Control" "private" } if { [HTTP::status] starts_with "5" } { HTTP::redirect "/autherror.html" } if { [HTTP::status] starts_with "4" } { HTTP::redirect "/autherror.html" } } Hope that helps
Create an account or sign in to comment