properly resolve redirect urls