Forum Discussion
Irule to redirect based on both IP and URI else default
- Aug 28, 2019
Sorry, try this. Couldn't quite remember where to put the parentheses.
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/notcool") && ([IP::client_addr] equals "1.1.1.1")} {
HTTP::redirect "https://coolnewpage.com/supercool"
}
else
{
pool notcool_pool
}
}
}
Try something like this? From what I've seen, when you've got two conditions to check, you have surround each with parentheses.
when HTTP_REQUEST {
if ( { [HTTP::uri] starts_with "/notcool"}) && ({[IP::client_addr] equals "1.1.1.1"}) {
HTTP::redirect "https://coolnewpage.com/supercool"
}
else
{
pool notcool_pool
}
}
}
Recent Discussions
Related Content
* 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