Forum Discussion
SSHSSH_97332
Nimbostratus
Nov 13, 2012Sending Block Page to user
i want to send block page to user
will the below Irule work :
when HTTP_REQUEST {
log local0. "Log me one time"
log local0. " [HTTP::uri] "
HTTP::respond 200 content {
We are sorry, but you cannot access [HTTP::uri]
}
}
it seems to be working , but value [HTTP::uri] inside page is shown as [HTTP::uri] not as the URI ?
12 Replies
- hoolio
Cirrostratus
The curly braces around the content prevent variable expansion. You can use double quotes and escape all the meta-characters except around [HTTP::uri] or use subst instead. Here's a recent example:
http://www.tcl.tk/man/tcl8.4/TclCmd/subst.htm
https://devcentral.f5.com/community/groupdetails/tabid/1082223/aft/2158958/asg/50/default.aspx2234979
Aaronwhen HTTP_REQUEST { log local0. "Log me one time" log local0. " [HTTP::uri] " HTTP::respond 200 content [subst { Blocking Page We are sorry, but you were blocked due to [HTTP::uri] }] - SSHSSH_97332
Nimbostratus
Thanks alot , This one worked . Now i was simulating that because i wanted to send Block page to users when ASM is detecting Violation instead of Support-ID , will the below be good or the custom predefined block page will continue to besent even with the below :
https://devcentral.f5.com/wiki/iRules.ASM__violation_data.ashxwhen ASM_REQUEST_VIOLATION { log local0. "Violation detected" log local0. " [HTTP::uri] " HTTP::respond 200 content [subst { Blocking Page We are sorry, but you were blocked due to [ASM::violation_data] in [HTTP::uri] }] }
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