Forum Discussion

Albert__Tase_70's avatar
Albert__Tase_70
Icon for Nimbostratus rankNimbostratus
Dec 11, 2006

need help converting this huge rule from 4 to 9.2.4

if (http_host contains "www.macmillanmedical.com") {

 

redirect to "www.macmillanmedicalcommunications.com"

 

}

 

else if (http_host contains "www.macmedcoms.com") {

 

redirect to "www.macmillanmedicalcommunications.com"

 

}

 

else if (http_host contains "www.macmillanmedicalcommunications.de") {

 

redirect to "www.macmillanmedicalcommunications.com/de/index.html"

 

}

 

else if (http_host contains "www.macmillanmedicalcommunications.es") {

 

redirect to "www.macmillanmedicalcommunications.com/es/index.html"

 

}

 

else if (http_host contains "www.macmillanmedicalcommunications.jp") {

 

redirect to "www.macmillanmedicalcommunications.com/jp/index_ja.html?lang=ja"

 

}

 

else if (http_host == "www.macmillanmedicalcommunications.com" and http_uri ends_with "/jp/") {

 

redirect to "http://www.macmillanmedicalcommunications.com/jp/index_ja.html"

 

}

 

else {

 

use pool MMC

 

}

 

1 Reply

  • when HTTP_REQUEST {
      if { [HTTP::host] contains "www.macmillanmedical.com" } {
        HTTP::redirect "www.macmillanmedicalcommunications.com"
      } elseif { [HTTP::host] contains "www.macmedcoms.com" } {
        HTTP::redirect "www.macmillanmedicalcommunications.com"
      } elseif { [HTTP::host] contains "www.macmillanmedicalcommunications.de" } {
        HTTP::redirect "www.macmillanmedicalcommunications.com/de/index.html"
      } elseif { [HTTP::host] contains "www.macmillanmedicalcommunications.es" } {
        HTTP::redirect "www.macmillanmedicalcommunications.com/es/index.html"
      } elseif { [HTTP::host] contains "www.macmillanmedicalcommunications.jp" } {
        HTTP::redirect "www.macmillanmedicalcommunications.com/jp/index_ja.html?lang=ja"
      } elseif { ([HTTP::host] contains "www.macmillanmedicalcommunications.com") && ([HTTP::uri] ends_with "/jp/") } {
        HTTP::redirect "http://www.macmillanmedicalcommunications.com/jp/index_ja.html"
      } else {
        pool MMC
      }
    }

    -Joe