HTML网页跳转代码大全网页自动跳转代码[分享]

2023-10-02 0 1,276

前言:

很多初学者在学习网站建设时,对于网页跳转代码的编写感到困惑。也就是说,如何实现从一个网页跳转到另一个网页或网站。下面,汇站将分享一份包含全面的网页自动跳转代码大全,希望能对大家有所帮助。欢迎大家采纳!

html直接跳转网址代码 自动跳转到其他网站代码

1、HTML 网页跳转代码(可隐藏跳转后网址)

 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IT 备忘录</title>
<frameset framespacing="0" border="0" rows="0" frameborder="0">
<frame name="main" src="https://www.huizhanii.com/" scrolling="auto" noresize></frameset>
</head>
<body></body>
</html>  

2、HTML 网页直接跳转代码

 <meta http-equiv="refresh" content="0; url=https://www.huizhanii.com">  

3、PHP 网页跳转代码

 <?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://www.huizhanii.com");
exit();
?>
  

4、JavaScript网页跳转代码

 <script language="javascript">
top.location='https://www.huizhanii.com';
</script>  

5、Apache(301)跳转代码

 Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://www.huizhanii.com$1 [R=301,L]  

6、ASP 网页跳转代码

 <%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","https://www.huizhanii.com"
Response.End
%>
  

7、ASP.NET(301)跳转代码

 <%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
HttpContext.Current.Response.StatusCode = 301;
HttpContext.Current.Response.Status = "301 Moved Permanently";
HttpContext.Current.Response.AddHeader("Location", https://www.huizhanii.com);
}  

8、Perl 跳转代码

$q = new CGI;
print $q->redirect("https://www.huizhanii.com");   

9、Pyton 跳转代码

 from django import http
def view(request):
return http.HttpResponseRedirect('https://www.huizhanii.com')  

10、Nginx 301 网页跳转代码

 if ($host ~ '^itmemo.cn'){
    return 301 https://www.huizhanii.com$request_uri;
}  

结语:

以上网页跳转代码,大家根据自己的情况复制粘贴,修改跳转网址即可。

本文章已结束,如转载请注明:汇站网 » HTML 网页跳转代码大全网页自动跳转代码[分享]

收藏 (0)

微信支付 微信扫一扫

支付宝支付 支付宝扫一扫

打赏二维码
点赞 (0)

站长资源下载中心-找源码上汇站

常见问题
  • 如果付款后没有弹出下载页面,多刷新几下,有问题联系客服!
查看详情
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
查看详情

相关文章

联系官方客服

为您解决烦忧 - 24小时在线 专业服务