Forum Discussion
Wes_98712
Nimbostratus
Nov 09, 2005undefined procedure: elseif
Ok,
This conversion process is killing me, I almost had a good chunk of my v4.X converted, and working (meaning my 3400 series LB wasn't rebooting...good thing). Now I have a strange issue, ...
Nov 09, 2005
This is a common issue that seems to crop up every so often. Actually, TCL forces elseif's to be on the same line as the closing brace and the opening brace after it has to be on the same line as well. We've made some changes to the TCL interpreter to allow newlines but there is a bug that you can't have whitespace after the brace and before the newline. I believe this has been fixed in the latest release.
So, as a rule, you should probably go with the way that TCL mandates to avoid any issues...
if { condition } {
...
} elseif { condition } {
...
} else {
...
}Sorry for the inconvenience...
BTW, I would highly suggest you remove the matches_regex in your iRule. You are incurring the cost of the regular expression engine when you aren't actually using a regular expression. The contains operator is much more efficient.
when HTTP_REQUEST {
set my_uri [HTTP::uri]
set my_query [HTTP::query]
if { [HTTP::host] equals "soaringdreams.ameriquest.com"} {
HTTP::respond 301 "Location" "http://www.ameriquestsoaringdreams.com"
} elseif { $my_uri contains "texas" } {
HTTP::respond 301 "Location" "http://www.ameriquestmortgage.com/index.html?ad=texasfair"
} elseif { $my_uri contains "cfide" } {
discard
} elseif { $my_uri starts_with "/Amigo"} {
HTTP::respond 301 "Location" "http://www.ameriquestmortgage.com/sweepStakes/showRegistration.html?lang=es&ad=LMAMIGO"
} elseif { $my_uri starts_with "/LuisMiguelFriend"} {
HTTP::respond
}
}Is there a reason why the matches_regex is in there that I'm missing?
-Joe
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
