Gary_Bristol_19
Nov 06, 2015Nimbostratus
Search External Data Group with default pool with no match
conditions to be met.
1. search External Data Group file for match on pool or redirect. works
2. send the base url to the CMS systems done
3. on external data group miss or something that is more than just the base URL, like www.ou.edu/george
it needs to be sent to specific pool ??
when RULE_INIT {
Turn Debug on or off (0=off 1=on)
Turn debug off in prod
set static::redir_debug 1
}
when HTTP_REQUEST {
Use following to match against datagroup
Use following to match against datagroup
set match_string [string tolower [HTTP::host]]
append match_string [string tolower [HTTP::path]]
if {$static::redir_debug}{log local0. "Match String: $match_string"}
Lookup the redirect or pool based upon match_string value
set goto [class match -value [string tolower [HTTP::host][HTTP::path]] starts_with www_ou_edu_redir_class]
if { $goto equals ""}{
if {$static::redir_debug}{log local0. "Match String Not Found"}
pool ouwww_bostitch
return
}
if { [getfield $goto "," 1] equals "pool" } {
if {$static::redir_debug}{log local0. "Pool declaration detected. Going to: [getfield $goto "," 2]"}
pool [getfield $goto "," 2]
} else {
if {$static::redir_debug}{log local0. "Redirect declaration detected. Redirecting to: [getfield $goto "," 2]"}
HTTP::redirect http://[getfield $goto "," 2]
}
}
Some sample Data
admissions.ou.edu := "redir,www.ou.edu/admissions.html",
action.ou.edu := "pool,ouwww_bostitch",
academictech.ou.edu := "redir,ouacademictech.com",
aasa.ou.edu := "redir",www.ou.edu/studentlife/diverse_communities/asian_american_studentlife/groups/aasa.html",
www.ou.edu := "pool,www_ou_edu_cms_servers",
so in this instance if a request came in for www.ou.edu/george it needs to fall through and go to the ouwww_bostitch pool.
Right now everything that doesn't match in the EDG goes to CMS pool.