代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="refresh" content="0;url=https://aa.bb.html">
<title></title>
</head>
<body>
<p><h1></h1></p>
</body>
</html>
其中,这段代码是设置浏览器的缓存策略(兼容新旧版本浏览器),为了避免使用后产生缓存,下次替换跳转链接后还得手动清缓存才能生效。
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
以下代码是自动跳转到指定地址
<meta http-equiv="refresh" content="0;url=https://aa.bb.html">