Forum Discussion
Gary_Bristol_19
Nimbostratus
Oct 08, 2015I am really bad at this,
I am attempting to incorporate some previous examples into a iRule that will do the following as I can't see to get a Data group File to work.
what i need to do is the following
I have attempted to ...
Gary_Bristol_19
Nimbostratus
Oct 08, 2015So here is what i was able to come up with, not pretty, but i still have problems with these url's falling through properly.
webapps.ou.edu/it/phonerates := pool,nor-it-webapps_pool,
webapps.ou.edu := pool,nor-it-webapps_pool,
webapps.ou.edu/flex2gateway := pool,nor-it-webapps_pool,
webapps.ou.edu/supporttool := pool,nor-it-webapps_pool,
when HTTP_REQUEST {
set lhost [string tolower [HTTP::host]]
set lpath [string tolower [HTTP::path]]
if { $lhost equals "lms.ou.edu" } {
HTTP::redirect "http://learn.ou.edu"
}
if { $lhost equals "survey.ou.edu" } {
HTTP::redirect "https://ousurvey.qualtrics.com"
}
if { $lhost equals "tutoring.ou.edu" } {
HTTP::redirect "http://www.ou.edu/graduatesooner/resources/tutoring.html"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/alerts") }{
HTTP::redirect "http://www.ou.edu/ouit/help/alerts"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/elections") }{
HTTP::redirect "https://orgsync.com/122675/chapter"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/hsp") }{
HTTP::redirect "http://www.ou.edu/hsp.html"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it/faculty") }{
HTTP::redirect "http://www.ou.edu/ouit"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it/staff") }{
HTTP::redirect "http://www.ou.edu/ouit"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it/students") }{
HTTP::redirect "http://www.ou.edu/ouit"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it/identity") }{
HTTP::redirect "http://www.ou.edu/content/ouit/security/top10/safeguard_your_personalinformation.html"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it/newstudents") }{
HTTP::redirect "http://www.ou.edu/ouit/new.html"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/it") }{
HTTP::redirect "http://www.ou.edu/ouit"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/security") }{
HTTP::redirect "http://www.ou.edu/ouit/security"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/studentservices") }{
HTTP::redirect "http://www.ou.edu/ouit/aud/students"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/students") }{
HTTP::redirect "http://www.ou.edu/ouit/aud/students"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/support") }{
HTTP::redirect "http://www.ou.edu/content/ouit/help/personal.html"
}
if { $lhost equals "webapps.ou.edu" } {
if { ($lpath starts_with "/virtualtour") }{
HTTP::redirect "http://www.ou.edu/map"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
- Brad_ParkerOct 08, 2015
Cirrus
No offense, but eww. I'm working on cleaning this up a bit for you. All those IFs are very inefficient. - Michael_JenkinsOct 08, 2015
Cirrostratus
With all the if statements, you'll likely run into multiples being valid as you traverse down. Did you try the code I added above? Did that help at all? It seemed to work when testing it on the BIG-IP through tclsh.
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