fix when $_SERVER['HTTPS'] is "ON"

when $_SERVER['HTTPS'] is "ON" it doesn't work well