$http = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http'; Che ne dite e buono come controllo ?! come fareste voi ?