Forum Discussion
esexon_27963
Nimbostratus
Jun 19, 2012Help with IRule
Hello again. I am having issues with my iRule. Running code BIG-IP 10.2.1 Build 297.0 Final iRule --------------------------- ...
Michael_Yates
Nimbostratus
Jun 19, 2012Hi esexon,
You could change your logic a little bit and save yourself some unnecessary processing.
Only trigger the verification if the URI contains "cms-admin". If it does, then check to see if they are authorized.
Here are two different ways of doing it....
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/cms-admin" } {
If URI matches verify that the Client has access
if { !([class match [IP::client_addr] equals AllowedNetworkList ]) } {
If they do NOT have access, do this:
HTTP::redirect "http://www.google.com"
}
}
}
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/cms-admin" } {
If URI matches verify that the Client has access
if { [class match [IP::client_addr] equals BlockNetworkList] } {
If they DO have access, do this:
HTTP::redirect "http://www.google.com"
}
}
}
Hope this helps.
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