网址跳转最常用的代码实现方法

1
2
3
4
5
6
7
8
9
10
11
网址跳转最常用的代码实现方法:
HTML版本
1<script language='javascript'>document.location='http://xxx' </script>  放在<head> </head>部分即可
2<meta http-equiv="refresh" content="1;url=http://xxx">  放在<head> </head>部分即可
以上代码添加到网站的静态首页文件里面。

PHP版本
$duankou=$_SERVER["SERVER_PORT"];
$dqurl=$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($duankou=="80"){header("location:https://".$dqurl);}
以上代码添加到index.php页面即可

相关新闻

联系我们

全国服务热线

400-033-9553

电子邮件:admin@example.com
工作时间:09:00-17:00 周一至周五

在线客服
关注微信
关注微信
分享本页
返回顶部