Craig_Gibb_1781
Apr 22, 2015Nimbostratus
Problem with multiple redirects in irule
Hi anyone suggest how this irule could work better iam having problems with it at the moment too many redirects and the syntax is not that great.
when HTTP_REQUEST { if { [HTTP::uri] contains "/PUTV1-" } { set host [string map {vodrr-stage.site.se stage.site.se} [HTTP::host]] log local0. "Incoming URI = [HTTP::uri]" if { [string tolower [HTTP::uri]] starts_with "/vod" } { set uri [string map {"/vod" "/nPVR"} [HTTP::uri]] log local0. "New URI = $uri" HTTP::uri $uri }
HTTP::redirect "http://$host[HTTP::uri]"
} else {
set host [string map {vodrr-stage.site.se cu.site.se} [HTTP::host]]
HTTP::redirect "http://$host[HTTP::uri]"
}
}
/Thanks Craig