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
}
}
}
Hey Atoth,
I can't save it, i am getting this error not sure if I missed something in your response?
Rule [/Common/test-jose] error: /Common/test-jose:2: error: [parse error: PARSE syntax 23 {syntax error in expression "(": premature end of expression}][(]
/Common/test-jose:2: error: [undefined procedure: )][)]
/Common/test-jose:2: error: [undefined procedure: &&][if ( { [HTTP::uri] starts_with "/notcool"}) && ({[IP::client_addr] equals "1.1.1.1"}) {
HTTP::redirect "https://coolnewpage.com/supercool"
}
else
{
pool notcool_pool
}]
/Common/test-jose:10: error: [command is not valid in the current scope][}]
Thanks
Joe
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