Forum Discussion
Kalpesh_48932
Nimbostratus
Oct 05, 2012irule with Contains operator
Hi All,
I have created irule, in fact wanted to have similar irule with contains operator.
when HTTP_REQUEST {
if {
[HTTP::uri] contains "AMSLang"
} then {
HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8201"}
{
HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8200"}
}
but it gives error in line 6. can someone please help with this.
error:
01070151:3: Rule [irule_ofx_idispo_ams_1.0] error: line 6: [undefined procedure: HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8200"] [{ HTTP::redirect http://sgsiaxhrmsgr1.saint-gobain.com:8200}]
Thanks
- What_Lies_Bene1
Cirrostratus
No need for the 'then'. Also, you seem to be redirecting twice, should there be another if in there?when HTTP_REQUEST { if { [HTTP::uri] contains "AMSLang" } { HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8201" } }
- nathe
Cirrocumulus
Or do you need to redirect all other requests to port 8200?when HTTP_REQUEST { if {[HTTP::uri] contains "AMSLang"} { HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8201" } else { HTTP::redirect "http://sgsiaxhrmsgr1.saint-gobain.com:8200" } }
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