Add redirect support

Adds redirect support backported from the AliSoftware repo.