jermc777_185784
Nov 21, 2018Nimbostratus
Irule Redirect with Datagroup
I have the following Irule and data group working (If I go to jerry.com/jerry it redirects me to http://www.msn.com/en-us/news) What I would like add to the functionality if possible is if I were to go to jerry.com/jerry/123 it redirect me to http://www.msn.com/en-us/news/jerry/123. So I would like it to remember the /jerry/123 and append that to the redirected url. Can anyone tell me if this is possible with the syntax of the irule and datagroup. Below are the contents of my irule and datagroup:
Name: datagroup_uri_list
String: jerry.va.gov/jerry
Value: www.msn.com/en-us/news
Irule is
when HTTP_REQUEST {
if { [class match [HTTP::host][HTTP::uri] equals datagroup_uri_list] } {
set redirect_value [class match -value [HTTP::host][HTTP::uri] eq datagroup_uri_list]
HTTP::respond 302 Location
HTTP::redirect "http://$redirect_value"
}
}