redirects: add more extensible support for redirects