Added SSL support and redirection if SSL is enabled