Forum Discussion
eliton_199802
Nimbostratus
7 years agoiRule to redirect to URLs
Hi All,
I am in need of an iRule that redirects users to URLs based on their source IP. I am attaching it to a standard VS with no pool defined. This is what I have come up with, however it does no...
stan_piron
Cumulonimbus
7 years agoDo you want to redirecct or to forward to internal servers with such hostnames?
if you want to redirect, this code may work. you can optimize it with elseif:
when HTTP_REQUEST {
if { ( [IP::addr [IP::client_addr] equals 10.50.1.0/24] ) } {
HTTP::redirect "http://abc1.test.com"
} elseif { ( [IP::addr [IP::client_addr] equals 10.60.1.0/24] ) } {
HTTP::redirect "http://abc2.test.com"
} elseif { ( [IP::addr [IP::client_addr] equals 10.70.1.0/24] ) } {
HTTP::redirect "http://abc3.test.com"
}
}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