Rewrite path with regex