Forum Discussion
Bayan_El_Ameen1
Oct 04, 2011Nimbostratus
Redirection iRule on ASM Blocking
Hello,
I need an iRule to redirect to home page when the ASM blocks a request.
I know that this can be achieved by selecting a redirect url for the response page instead of using the default response page but I need something more general for I have multiple applications and I want to manage that in an iRule.
I have tried the following iRule but it's not working:
when ASM_REQUEST_BLOCKING {
HTTP::redirect https://[HTTP::host]/
}
Thanks,
Bayan El Ameen
- TortiAltostratussince i have changed my irule to this:
when ASM_REQUEST_VIOLATION { get violation informations set x [ASM::violation_data] set vio [lindex $x 0] set uri [HTTP::uri] set host [HTTP::host] } when ASM_REQUEST_BLOCKING { get violation informationsand set defaults set x [ASM::violation_data] set vio [lindex $x 0] switch through violation events switch $vio { "VIOLATION_OBJ_DOESNT_EXIST" - "VIOLATION_METACHAR_IN_OBJ" { log local0. "www.host.de --> Blocking $vio (illegal URL), uri=$uri, host=$host" redirect without Server Header to requested host/index.asp HTTP::respond 302 noserver Location "http://$host/index.asp" } } }
- TortiAltostratusupdate:
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