3

I want to redirect URLs like this /origin/something to this /destination/something. I tried to do it using redir, but I didn't be able to get just some part of the path by using a placeholder. Then I tried with rewrite in these ways:

rewrite /origin {
  r (.*)
  to /destination{1}
}

rewrite {
  if {path} not_starts_with /origin
  to /{path} /{path}/
}
rewrite {
  r ^/origin/(.*)
  to /destination{1}
}

rewrite {
  if {path} not_starts_with /origin
  to /{path} /{path}/
}

In both ways it doesn't work. What am I doing wrong? How can I do this redirection?

0 Answers0