Forum Discussion
ahmed_ismail_21
Nimbostratus
Jun 05, 2016why F5 give me this error
looking for close parenthesis}][{($allowed == 0) and ([HTTP::uri] end_with "/register")}]
when CLIENT_ACCEPTED {
set allowed 0
if { [ class match -- [whereis [IP::client_addr] country]...
Yann_Desmarest
Cirrus
Jun 07, 2016Hi,
([whereis [IP::client_addr] country] equals "EG") or (![whereis [IP::client_addr] country ] equals "EG") are the exact opposite.
You have to remove one of the condition. Because of possible subsequent requests, I suggest to change a little bit your irule. For example :
when HTTP_REQUEST {
set allowed 0
if { !([whereis [IP::client_addr] country ] equals "EG") } {
set allowed 1
}
if { ($allowed == 0) and ([HTTP::path] ends_with "/register") } {
HTTP::redirect "http://www.test.com/register"
} elseif { ($allowed == 1) and ([HTTP::path] ends_with "/register") } {
HTTP::redirect "http://www.test/login"
} else {
pool test
}
}
ahmed_ismail_21
Nimbostratus
Jun 07, 2016Hi Yann,
First Thank you, but unfortunately didn't work at all even the main website didn't work, means when I tried to open the main website test.com, which match on pool test didn't open, wrap up, the redirect and main page of website didn't work.
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