Redirecting with a regex

I have a simple use-case: I want to redirect all pages from to

The goal is thus to redirect all pages found by a regexp.

Found here:, the trick is to use a rewrite rule then a redir rule in order to trigger the rewrite_uri placeholder.

rewrite {
  r ^/en/(.*)
  to /{1}

redir {
  if {uri} not {rewrite_uri}
  /{rewrite_uri} 301