fix https redirect issue