added ssl support and redirects