I am having trouble committing the following iRule when adding in comments above the elseif statements. It always interprets the first comment it finds above an elseif statement as the offender.
01070151:3: Rule [/Common/Main_Website_80_Revised] error: /Common/Main_Website_80_Revised:7: error: [undefined procedure: elseif][elseif {[class match [HTTP::host] eq group_80_encrypt]} {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}]
Removing all comments (aside from line 2, that one seems fine) will commit the iRule without any issue. Any idea what might be going on?
when HTTP_REQUEST {
302 redirect to a different URL based on hostname
if {[class match [HTTP::host] eq group_80_host_redirect]} {
HTTP::redirect [class match -value [HTTP::host] eq group_80_host_redirect]
}
302 redirect to enforce HTTPS based on hostname or URI
elseif {[class match [HTTP::host] eq group_80_encrypt]} {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
Pool selection based on hostname
elseif {[class match [HTTP::host] eq group_80_host_pool]} {
pool [class match -value [HTTP::host] eq group_80_host_pool]
}
Pool selection based on URI
elseif {[class match [HTTP::uri] starts_with group_80_uri_pool]} {
pool [class match -value [HTTP::uri] starts_with group_80_uri_pool]
}
else {
pool Main_80_Pool
}
}