implement redirect for legacy ids

this will be used from varnish to compute redirects, which will then land in webview.