Fix for #1 and rewrite code for #2

For #2 the DCA config has to be done. The used variable is "redirectToHTTPS"