Forum Discussion
skarpovi_111573
Nimbostratus
Mar 25, 2008Redirect based on the source IP
Folks, can anyone help.
i need something like this:
when HTTP_REQUEST {
if { [TCP::local_port] eq "80" } """ and source IP = 10.x.x.x"""" then redirect to
{
...
Nicolas_Menant
Employee
Mar 25, 2008This code complie on my bigip, after if you still have issue, i would recommend to use the iRule editor which will help you to troubleshoot syntax
when HTTP_REQUEST {
if {([TCP::local_port] eq "80") and ([IP::client_addr] eq "10.2.3.4")} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]AAA-link1"
} elseif {[TCP::local_port] eq "80" } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]BBB-link2"
} else {
pool eRoom-Servers-Pool
}
}
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