use correct base uri when being redirected