Forum Discussion

Albert_Tase_112's avatar
Albert_Tase_112
Icon for Nimbostratus rankNimbostratus
Aug 16, 2006

I need to migrate these rules from 4.0 to 9.2.3

rule bms-staging-https-redirect {

 

if (http_uri starts_with "/contact") {

 

use pool bms_209.34.86.89_8080

 

}

 

else if (http_uri starts_with "/radmin") {

 

redirect to "https://staging.ikonsupplies.com/"

 

}

 

else {

 

use pool BMS_209.34.86.89_80

 

}

 

}

 

 

rule BMS_IKON_Contact_Rule {

 

if (http_uri starts_with "/contact") {

 

use pool bms_ikon_209.34.86.91_7077

 

}

 

else if (http_uri starts_with "/radmin") {

 

use pool BMS-Radmin

 

}

 

else {

 

use pool bms_ikon209.34.82.94_80

 

}

 

}

 

 

rule bms-staging-http-redirect {

 

if (http_uri starts_with "/contact") {

 

redirect to "https://staging.ikonsupplies.com/contact/login.jsp"

 

}

 

else if (http_uri starts_with "/radmin") {

 

redirect to "http://staging.ikonsupplies.com/"

 

}

 

else {

 

use pool BMS_ikonsupplies_staging

 

}

 

}

 

 

rule www.ikonsupplies.com_rule {

 

if (http_uri starts_with "/radmin") {

 

redirect to "https://www.ikonsupplies.com/radmin/login.jsp"

 

}

 

else {

 

use pool bms_ikon209.34.82.94_80

 

}

 

}

 

 

rule bms-ikon-http {

 

if (http_uri starts_with "/contact") {

 

use pool bms_ikon_209.34.86.91_7077

 

}

 

else if (http_uri starts_with "/radmin") {

 

redirect to "http://supplies.ikon.com/"

 

}

 

else {

 

use pool bms_ikon209.34.82.94_80

 

}

 

}

 

 

Keep getting syntax errors please help they worked fine on veriosn 4.0 code

 

  • Here is the proper syntax for the first rule. Use it as an example to correct the others as well.

    rule bms-staging-https-redirect {
    when HTTP_REQUEST {
      if {[HTTP::uri] starts_with "/contact"} {
        pool bms_209.34.86.89_8080
      } elseif { [HTTP::uri] starts_with "/radmin"} {
        HTTP::redirect "https://staging.ikonsupplies.com/"
      } else {
        pool BMS_209.34.86.89_80
      }
    }
    }