Add a urlrewriter for urls that redirect. fix #2702