Fixed bug with redirect to HTTPS