craig_jones_103
Mar 22, 2009Nimbostratus
Newbe to Irules and I need Help Urgently
Hi there Folks.
I am new to F5 and this is the First IRule that I am trying to get operating and as usual it needed in a rush.
We have a web site "http://a.b.com and normall all traffic to this has to be redirected to HTTPS://a.b.com except that is if the URL is http://a.b.com/cd.xml na dif it is we need it to go to the pool "POOL_A.B.COM" on http.
I have tried the following rules with the errors given.
IRULE
when HTTP_REQUEST {
if {[HTTP::uri] equals {ws.digitalrecordcenter.com/crossdomain.xml}} {snat 10.195.3.162} {pool POOL_WS.DRC.COM_EN
} else {HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
ERROR
01070151:3: Rule [Irule_WS.HTTP-to-HTTPS_301] error:
line 2: [deprecated usage, use else or elseif] [ ]
line 2: [undefined procedure: else] [if {[HTTP::uri] equals {ws.digitalrecordcenter.com/crossdomain.xml}} {snat 10.195.3.162} {pool POOL_WS.DRC.COM_EN
} else {HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}]
and also
IRULE
when HTTP_REQUEST {
if {[HTTP::uri] equals "ws.digitalrecordcenter.com/crossdomain.xml"} {
snat 10.195.3.162} {pool POOL_WS.DRC.COM_EN
}
elseif {[HTTP::uri] equals "ws.digitalrecordcenter.com"} {
HTTP::redirect https://ws.digitalrecordcenter.com/]
}
}
ERROR
01070151:3: Rule [Irule_WS.HTTP-to-HTTPS_301] error:
line 3: [deprecated usage, use else or elseif] [ ]
line 2: [undefined procedure: elseif] [if {[HTTP::uri] equals "ws.digitalrecordcenter.com/crossdomain.xml"} {
snat 10.195.3.162} {pool POOL_WS.DRC.COM_EN
}
elseif {[HTTP::uri] equals "ws.digitalrecordcenter.com"} {
HTTP::redirect https://ws.digitalrecordcenter.com/]
}]
Can any of you guys give an explanation to a complete novice as to what the Irule might be or where I am going wrong on this.
any help you can offer would be greatly apprecaited.
Regards.
Craig Jones