Forum Discussion
Gary_Bristol_19
Nimbostratus
Dec 15, 2015additional conditions on an irule
i have an iRule that does a check for a home page if it matches then send it to a specific pool.
then i check a External Data Group list for redirection and pool selections or a default pool for none...
Gary_Bristol_19
Nimbostratus
Dec 15, 2015This seems to work but is not as Eloquent as what has been provided from here..
when HTTP_REQUEST {
Lookup the redirect or pool based upon match_string value
if { [string tolower [HTTP::host][HTTP::path]] equals "ou.edu/" }{
HTTP::redirect "http://www.ou.edu/"
}
set goto [class match -value [string tolower [HTTP::host][HTTP::path]] starts_with www_ou_edu_redir_class]
if { [string tolower [HTTP::host][HTTP::path]] equals "www.ou.edu/" }{
pool www_ou_edu_cms_servers
} else {
switch [getfield $goto "," 1] {
"pool" { pool [getfield $goto "," 2] }
"redir" { HTTP::redirect [getfield $goto "," 2] }
default { pool ouwww_bostitch }
}
}
}
- Kai_WilkeDec 15, 2015
MVP
Hi Gary, I don't get the purpose of "pool ouwww_bostitch" and "pool www_ou_edu_cms_servers". Please explain which URLs (host/path) should be routed to those pools. Specify some wildcards if needed... Cheers, Kai - Gary_Bristol_19Dec 15, 2015
Nimbostratus
Those pools are where the content resides for specific web pages as defined in an External Data Group File. So the CMS Pool is where the centrally managed University web site lives but the Bostitch is where the Faculty staff web sites live. so depending on the url they would be directed to the specific pool or redirected to a different url, but there are some default actions that need to happen which is why there are the different conditions. - Gary_Bristol_19Dec 15, 2015
Nimbostratus
For instance here are some sampe entries www.parking.ou.edu := "redir,http://www.ou.edu/parking.html", www.outreach.ou.edu := "redir,http://www.ou.edu/outreach.html", www.oubc.ou.edu := "redir,http://www.ou.edu/coe/bioengineering/home.html", www.ou.edu/ymvw := "pool,www_ou_edu_cms_servers", www.ou.edu/writingcenter := "pool,www_ou_edu_cms_servers", www.ou.edu/writing := "pool,www_ou_edu_cms_servers", www.ou.edu/wpge := "redir,http://wpge25.wix.com/wpge", tour.ou.edu := "redir,http://www.ou.edu/go2/visit.html", tinker.ou.edu := "redir,http://www.ou.edu/cls/ou_tinker.html", thecore.ou.edu := "redir,http://www.ou.edu/thecore", theatre.ou.edu := "redir,http://www.ou.edu/content/finearts/universitytheatre.html", techhelp.ou.edu := "redir,http://www.ou.edu/content/ouit/help/personal.html", teachin.ou.edu := "redir,http://www.ou.edu/publicaffairs/teachin.html", teach.ou.edu := "redir,http://www.ou.edu/cte", tcom.ou.edu := "redir,http://www.ou.edu/coe/tcom", tao.ou.edu := "redir,http://www.ou.edu/cte/tao/", annualreport.ou.edu := "redir,http://www.ou.edu/web/about_ou/communityimpactreport", ame.ou.edu := "redir,http://www.ou.edu/coe/ame/home.html", alumni.ou.edu := "redir,http://www.ou.edu/alumni", alumni.coa.ou.edu := "redir,http://www.ou.edu/content/architecture/aud/alumni_friends.html", alerts.ou.edu := "redir,http://www.ou.edu/ouit/help/alerts", alc.ou.edu := "redir,http://www.ou.edu/univcoll/alc", airport.ou.edu := "redir,http://www.ou.edu/airport.html", ou.edu/home := "pool,www_ou_edu_cms_servers", ou.edu/healthservices := "pool,www_ou_edu_cms_servers", ou.edu/healthcareoptions := "pool,ouwww_bostitch", ou.edu/harps := "pool,www_ou_edu_cms_servers", ou.edu/gradweb := "pool,www_ou_edu_cms_servers", - Kai_WilkeDec 15, 2015
MVP
Okay I got the purpose for the "pool ouwww_bostitch". Can you explain the format of the datagroup entries used to forward to this pool? Using "default" may be not be ideal... Does "pool www_ou_edu_cms_servers" just receive "equals www.ou.edu/" or should it be a "starts_with www.ou.edu/" condition (with the excemption of some redirects stored in the datagroup)? Cheers, Kai
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
