Forum Discussion
Blocking a specific URL on a specific VIP with iRule
Hello All,
I am fairly new to creating iRules, and have been trying to create an iRule for an application we are load balancing. Basically what i am trying to do is block a certain URL on a VIP that contains "/Pages/manageusers.aspx", as seen below. After creating the Rule though, it doesnt seem to be doing anything. I was hoping that someone could take a look at it and let me know if i am doing anything wrong here.
Code when HTTP_REQUEST {
if { ( ( [IP::addr [IP::local_addr] equals x.x.x.x] ) and [string tolower [HTTP::uri]] contains "/Pages/manageusers.aspx" ) } {
log local0. "dropped"
reject
}
}
Thanks, Mindo
Looks like you're doing a lower case string match against a string with an upper case character, hence it will never match:
[string tolower [HTTP::uri]] contains "/Pages/manageusers.aspx
Try changing the upper case P in pages to lower case and see if that fixes your issue.
- Cory_50405Noctilucent
Looks like you're doing a lower case string match against a string with an upper case character, hence it will never match:
[string tolower [HTTP::uri]] contains "/Pages/manageusers.aspx
Try changing the upper case P in pages to lower case and see if that fixes your issue.
- mindo_152998NimbostratusDoh!, that make a lot of sense. It is working now after changing that, Thank you very much!
Recent Discussions
Related Content
* 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