Fix redirection loop issue.