实用的多种样式网站自动跳转网址代码

实用的多种样式网站自动跳转网址代码

Hackeus
2022-07-26 / 0 评论 / 178 阅读 / 正在检测是否收录...

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>核客互动</title>
<frameset framespacing="0" border="0" rows="0" frameborder="0">
<frame name="main" src="https://blog.hackeus.cn" scrolling="auto" noresize></frameset>
</head>
<body></body>
</html>

2.HTML

<meta http-equiv="refresh" content="0; url=https://blog.hackeus.cn">

3.PHP

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://blog.hackeus.cn");
exit();
?>

4.JavaScript

<script language="javascript">
top.location='https://blog.hackeus.cn';
</script>

5.Apache(301)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://blog.hackeus.cn$1 [R=301,L]

6.ASP

<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","https://blog.hackeus.cn"
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://blog.hackeus.cn);
}
</script>

8.Perl

$q = new CGI;
print $q->redirect("https://blog.hackeus.cn");

9.Pyton

from django import http
def view(request):
return http.HttpResponseRedirect('https://blog.hackeus.cn')
0

评论

博主关闭了所有页面的评论