Fix HTTPS connection and redirect