Forum Discussion
Scott_82504
Nimbostratus
Nov 15, 2008IRules 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 connect...
Scott_82504
Nimbostratus
Nov 18, 2008Need some more help. As they did more testing we realized none of the graphic coming up on the the redirect pages. The redirect was trying to grab a image but getting redirect by catch all at the end. I am in same position as the first post.
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 ?
Is there a way around this ?
thanks again
Here was my original IRULE - this caused a loop over and over
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/dsc"} {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002958"
} elseif { [HTTP::uri] starts_with "/kantech" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002735"
} elseif { [HTTP::uri] starts_with "/acvs_catalog" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?cmd=catalog&BU=15004409"
} elseif { [HTTP::uri] starts_with "/acvs" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004408"
} elseif { [HTTP::uri] starts_with "/mac" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005009"
} elseif { [HTTP::uri] starts_with "/tycosafetyproducts-fire-europe" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005089"
} elseif { [HTTP::uri] starts_with "/scansource" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004826"
} elseif { [HTTP::uri] starts_with "/SimplexMear" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004867"
} elseif { [HTTP::uri] starts_with "/te" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004768"
} elseif { [HTTP::uri] starts_with "/physicalsecurity" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004506"
} elseif { [HTTP::uri] starts_with "/swh" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002734"
} elseif { [HTTP::uri] starts_with "/tfbp" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004445"
} elseif { [HTTP::uri] starts_with "/scott" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002988"
} elseif { [HTTP::uri] starts_with "/bentel" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002959"
} elseif { [HTTP::uri] starts_with "/surgard" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002959"
} elseif { [HTTP::uri] starts_with "/amerdyn" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002733"
} elseif { [HTTP::uri] starts_with "/cemsys" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002736"
} elseif { [HTTP::uri] starts_with "/ADTContractors" } {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005329"
} else {
HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=10003010"
}
}
this is what I have today and I am missing graphic.
when HTTP_REQUEST {
if {not ([string tolower [HTTP::uri]] starts_with "/knav/nav")} {
switch -glob [string tolower [HTTP::uri]] {
"/dsc*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002958" }
"/kantech*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002735" }
"/acvs_catalog*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?cmd=catalog&BU=15004409"}
"/acvs*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004408"}
"/mac*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005009"}
"/tycosafetyproducts-fire-europe*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005089"}
"/scansource*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004826"}
"/simplexmear*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004867"}
"/te*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004768"}
"/physicalsecurity*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004506"}
"/swh*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002734"}
"/tfbp*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15004445"}
"/scott*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002988"}
"/bentel*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002959"}
"/surgard*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002960"}
"/amerdyn*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002733"}
"/cemsys*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15002736"}
"/adtcontractors*"
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=15005329"}
default
{ HTTP::redirect "http://lms2.tyco-training.com/knav/nav?BU=10003010" }
}
}
}
HELP
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
