Replace redirect logic with RedirectException