Forum Discussion
Yozzer
Nimbostratus
Sep 13, 2012Parse error: PARSE syntax 372
Hi, I get the following parse error:
01070151:3: Rule [irule_redirect] error:
line 13: [parse error: PARSE syntax 372 {syntax error in expression "
return
": variable refe...
Michael_Yates
Nimbostratus
Sep 13, 2012Hi Yozzer,
Remove the elseif statement and the return.
You won't need either. If they qualify the the first event they will be redirected, if not then they will be caught by the else statement and also be redirected (in this case to the same location, but I am assuming that you sanitized the iRule to post it).
A return statement is only used when there is an event triggered in an iRule and you do something and you do not want any further iRule processing. The return statement will break out and not process any further conditions in the iRule.
Try this:
when HTTP_REQUEST {
set name "DC"
if {([string tolower [HTTP::method]] eq "get") && ([string tolower [HTTP::uri]] eq "/") && ([string tolower [HTTP::header "Referer"]] ne "http://cba.com") } {
if {([string tolower [HTTP::cookie value $name]] contains "session=&") } {
HTTP::redirect "http://www.abc.com"
}
else {
HTTP::redirect "http://www.abc.com"
}
}
}
Hope this helps.
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