veredgf_96123
Mar 31, 2019Nimbostratus
need to exclude certain files
Hi, I have an IRULE that sends people to a 404 page when there is a violation of "illegal URL".
Now I was given a second request that I should exclude all URLs leading to PDF files and instead redirect them to a different page. I have been trying to combine this second redirect request with and ELSE option but so far am unsuccessful. Adding a second IRULE won't work.
This is my IRULE:
when HTTP_REQUEST {
set asm_404_not_found 0
}
when ASM_REQUEST_BLOCKING {
set asm_info [ASM::violation_data]
Any response tweaking should only be done in blocking mode!!!
if {[string compare [ASM::status] "blocked"] == 0} {
if {[string first {VIOLATION_OBJ_DOESNT_EXIST} [lindex $asm_info 0]] != -1} {
set asm_404_not_found 1
ASM::disable
TCP::close
}
}
}
when HTTP_RESPONSE_RELEASE {
if {$asm_404_not_found == 1} {
HTTP::respond 301 Location "https://www.site.com/404.aspx"
}
}
Any ideas? (sorry for the horrible formatting)
Thanks,
Vered