网页自动跳转源码_网页自动随机跳转代码

日期:2024-02-22 分类:学习资料 浏览:318 来源:巴州老党网站制作工作室【巴州P911网站制作室】


1.HTML方式(可隐藏跳转后网址)

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

2.HTML跳转

<html>
<head>
<meta http-equiv="refresh" content="0; url=https://www.xishangju.com/?24">
</head>
<body>
</body>
</html>

3.PHP跳转

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

4.JavaScript跳转

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

5.Apache(301)跳转

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

6.ASP跳转

<%Response.Status="301 Moved Permanently"Response.AddHeader "Location","https://www.xishangju.com/?24"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.xishangju.com/?24);}

8.Perl跳转

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

9.Pyton跳转

from django import httpdef view(request):return http.HttpResponseRedirect('https://www.xishangju.com/?24')



上一篇:没有了

下一篇:要创建一个带有多种颜色背景的div

客服微信
咨询电话
13070015456