Forum Discussion

Scott_82504's avatar
Scott_82504
Icon for Nimbostratus rankNimbostratus
Nov 15, 2008

IRules Logic and wild care at the end

I am trying to figure out a set of IRULES. They are working for the most part. Here is my issue. If the rules do not match my any of my uri (kinda like a wildcard) I want to redirect the connection to another site. Example I type in lms2.tyco-training.com into the address bar and I want to redirect it to http://lms.tyco-training.com/knav/nav?BU=10003010. If I put anything else after example : lms2.tyco-training.com/abc (does not match uri in my rules below I want it to go to this same page http://lms.tyco-training.com/knav/nav?BU=10003010. How do I add this wild card rule ?

 

 

when HTTP_REQUEST {

 

 

if { [string tolower [HTTP::uri]] starts_with "/dsc"} {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002958"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/kantech" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002735"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/acvs_catalog" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?cmd=catalog&BU=15004409"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/acvs" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004408"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/mac" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005009"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/tycosafetyproducts-fire-europe" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005089"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/scansource" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004826"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/SimplexMear" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004867"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/te" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004768"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/physicalsecurity" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004506"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/swh" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002734"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/tfbp" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004445"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/scott" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002988"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/bentel" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002959"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/surgard" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002959"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/amerdyn" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002733"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/cemsys" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002736"

 

} elseif { [string tolower [HTTP::uri]] starts_with "/ADTContractors" } {

 

HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005329"

 

} else {

 

pool TIRCAP_76.24-80

 

}

 

}

 

 

 

THANKS IN ADVANCE

16 Replies