[TASK] Better handling of redirect