你可以试试这个。
echo '<META HTTP-EQUIV="Refresh" Content="0; URL='.$location.'">';
PHP(必须工作,无论浏览器版本/无脚本等):
header("Location: http://example.com/myOtherPage.php");
die();
JS(如果用户使用无脚本或IE,则无效。阅读更多:https://appendto.com/2016/04/javascript-redirect-how-to-redirect-a-web-page-with-javascript/):
window.location.href = "https://www.example.com";