Implement old redirect code

This implements the old redirect code. Please test it on-site to make sure I didn't break anything before pulling. Thanks!