Redirect example.com/* to www.example.com/$1

You can use concat function mentioned above, or you can fix your wildcard rule. The problem is in the target of the redirect. Static URL redirect target is interpreted as a string, so variable is not going to be expanded there.

What you need to do is:

  1. Change type from Static to Dynamic (this is required for concat method too, by the way)
  2. Change https://www.lamusiquedegenevieve.com/$1 to wildcard_replace(http.request.full_uri, "https://lamusiquedegenevieve.com/*", "https://www.lamusiquedegenevieve.com/${1}") in the URL redirect URL target

Note that the syntax for wildcard expansion is ${X}, where <X> indicates the index of a matched pattern. You can read more about it in wildcard replacement.

As I mentioned here, this process will become much easier and more intuitive once simplified URL with wildcard support is released for Single Redirects in the upcoming days. :wink:

1 Like