typo
prevent php warning if $_SERVER['HTTPS'] is not set, + better 'On' detection