Split $.redirect into two methods.
Apply new APIs.