Forum Discussion
Net_Admin_86160
Nimbostratus
Sep 10, 2013Doing redirects using datagroups
Hello,
I am trying to do redirects using datagroups and getting stuck with the actual redirect using -value
I have a data group called
prod_domains_dg
mydomain.ny1.com:=mydomain.ny1.com/1nyb
my...
Kevin_Stewart
Employee
Sep 10, 2013Try this:
Data group:
mydomain.ny1.com := /1nyb
mydomain.ny2.com := /2nyb
iRule:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
if { [class match [string tolower [HTTP::host]] equals Prod_Domains_dg] } {
HTTP::redirect [class match -value [string tolower [HTTP::host]] equals Prod_Domains_dg]
}
}
}
The pool, I assume, is already applied to the virtual server. So the above only redirects if the URI equals "/" and then redirects to the URI from the class match. Requests with more specific URIs are ignored.
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