Rewrite and redirect together in the same
match give a validation error:
admission webhook "pilot.validation.istio.io" denied the request:
configuration is invalid: HTTP route cannot contain both route and redirect
I was able to get it to work by doing them in different
match blocks. This works but is cumbersome. Here is an example that works with Bookinfo. If the user does not specify a valid Bookinfo PATH this rule routes to httpbin and redirects to a particular URL on httpbin.
(You need to install bookinfo, bookinfo-gateway, httpbin, but not httpbin-gateway for my example rule to do anything interesting)
cat <<EOF | kubectl apply -f -