Forum Discussion
Mohammed_Moin_2
Nimbostratus
Sep 20, 2018redirect to URI based upon client public
How to redirect traffic to certain uri based upon client public IP
Lee_Sutcliffe
Nacreous
Sep 20, 2018You can use an Local Traffic Policy or a simple iRule to achieve this:
when HTTP_REQUEST {
if {[IP::addr [IP::client_addr] equals "1.2.3.4"]} {
HTTP::redirect https://some.host.com/new-uri
}
}
However Be careful - Do you really need a redirect or do you just want to change the URI? If you redirect (HTTP 302) you can get stuck in a loop if the redirect comes to the same VIP.
If you just need to change the URI, you can try the following
when HTTP_REQUEST {
if {[IP::addr [IP::client_addr] equals "1.2.3.4"]} {
HTTP::uri /new-uri/
}
}
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
