Forum Discussion
pkhatri_72515
Nimbostratus
Mar 31, 2010Need help with iRule
Dear Experts,
I need help with iRule:
currently i have following iRule: (which is working fine)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] starts_with "/classkb/") or ([string tolower [HTTP::uri]] equals "/classkb") } {
if { not ([matchclass [IP::client_addr] equals $::Classkb_allowed_IPs]) } {
log local0. "Caught [HTTP::uri] from [IP::client_addr]"
HTTP::redirect "http://static.blabla.com/403.htm"
}
}
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
now we need "/classkb/assests" url to be publically accessed, how would i modify this iRule? Need help with adding another if statement.
Thanks,
PK.
- Jason_Keating
Altostratus
How about something along the lines of this.when HTTP_REQUEST { set path [string tolower [HTTP::path]] log local0. $path switch -glob $path { "/classkb/assets"{ } "/classkb*"{ if { not ([matchclass [IP::client_addr] equals $::Classkb_allowed_IPs]) } { log local0. "Caught [HTTP::uri] from [IP::client_addr]" HTTP::redirect "http://static.blabla.com/403.htm" } } } }
- pkhatri_72515
Nimbostratus
Thanks, I will test and let you know, appreciate your help. - pkhatri_72515
Nimbostratus
That worked!! Thanks, - pkhatri_72515
Nimbostratus
well, guess I was wrong, users are reporting that they are able to now access - hoolio
Cirrostratus
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