Handles HTTP redirects