Forum Discussion
Bryce_Halkerst1
Nimbostratus
Apr 05, 2013Data Group with iRule 301 Redirects
All,
My client had Aaron Hooley assist with creating data group 301 redirects, however, the initial url product is being picked up by the apache http class. I tried doing http:class disable, bu...
Bryce_Halkerst1
Nimbostratus
May 08, 2013All,
Meant to update the resolution a while back. Worked with Aaron to finalize the irule, we had to disable http classes and update the syntax.
Thanks,
Bryce
Final working irule configuration:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::uri] contains prod -> [class match -value -- [HTTP::uri] contains datagroup301s]"
if {[set code_url [class match -value -- [string tolower [HTTP::host][HTTP::uri]] equals datagroup301s]] ne ""}
{
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting [HTTP::uri] to ([getfield $code_url " " 1]) [getfield $code_url " " 2]"
HTTP::class disable
HTTP::respond [getfield $code_url " " 1] Location [getfield $code_url " " 2]
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: No match for [HTTP::uri] in datagroup301s"
HTTP::class enable
}
}
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