fix https redirect to http error