HTTPS template fix

Fixed template files to work with https too.
