🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
以下是PHP实现,其实可 <?php function get_http_s(){ $top = 'http'; if($_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTPS'] == 1 ||$_SERVER['HTTPS'] == 'on') $top = 'https'; return $top; } $r = get_http_s(); if($r != 'https') { header("Location: https://".$_SERVER['HTTP_HOST']); }