Forum Discussion
Anthony_178254
Nimbostratus
Nov 02, 2016Complex logic -- Redirect to new URI based on IP in Data Group match.
Hi All, Need help from the many iRule expert here. I have an iRule that currently validate server availability and send to a maintenance page and also have a rule to match based on URI access. ...
Stanislas_Piro2
Cumulonimbus
Nov 03, 2016Hi,
you have only to add a new URI in your switch:
when HTTP_REQUEST {
if { [active_members MYPOOL-MYSITE-P443] < 1 } {
HTTP::redirect "http://maintenance.mysite.com" }
switch -glob [HTTP::uri] {
"/customers*"{
if {[IP::addr [IP::client_addr]/8 equals 10.0.0.0]} {
HTTP::redirect "/CustomerInternal"
}
}
"*/admin1*" -
"*/admin2*" {
if { !([matchclass [IP::client_addr] equals ADMIN-ALLLOWED-IP-LIST])} {
reject
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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