Fixed bug with reflect redirected url assuming the last redirect is always in-domain