implement redirect for legacy ids

this will be used from varnish to compute redirects, which will then land in webview.
Yup, cut & paste left over. Will fix.