handle http redirection