Forum Discussion
sundogbrew
Aug 28, 2019Altocumulus
Irule to redirect based on both IP and URI else default
Hey folks, I am trying to write an Irule that redirects based on IP & URI. So I want to say if you are coming from this IP 1.1.1.1 and your URI contains /notcool then redirect to a URL, otherwise j...
- 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
}
}
}
atoth
Aug 28, 2019Cirrus
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
}
}
}
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