免费空间 免费空间申请
首 页 免费注册 新闻资讯 空间服务 高速空间 主页列表 友情链接 关于我们
您当前的位置:免费空间 -> 新闻中心
栏目导航
· 网站公告
HTML网页跳转代码大全 网页自动跳转代码【分享】
发布时间:2023/4/25 共阅[59]次

减小字体 增大字体

很多新手在学习网站建设的时候,不清楚网页跳转代码怎么写?也就是从一个网页跳转到另外一个网页或网站,下面阿坝云小编就给大家分享一份比较全面的网页自动跳转代码大全给大家,欢迎大家采纳!

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

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="http://www.abayun.cn/" scrolling="auto" noresize></frameset> 

</head> 

<body></body> 

</html> 




2、HTML网页直接跳转代码

<meta http-equiv="refresh" content="0; url=http://www.abayun.cn"> 




3、PHP网页跳转代码

<?php 

header("HTTP/1.1 301 Moved Permanently"); 

header("Location: http://www.abayun.cn"); 

exit(); 

?> 





4、JavaScript网页跳转代码

<script language="javascript"> 

top.location='http://www.abayun.cn'; 

</script> 




5、Apache(301)跳转代码

Options +FollowSymLinks 

RewriteEngine on 

RewriteRule (.*) http://www.abayun.cn$1 [R=301,L] 




6、ASP网页跳转代码

<% 

Response.Status="301 Moved Permanently" 

Response.AddHeader "Location","http://www.abayun.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", http://www.abayun.cn); 




8、Perl跳转代码

$q = new CGI; 

print $q->redirect("http://www.abayun.cn"); 




9、Pyton跳转代码

from django import http 

def view(request): 

return http.HttpResponseRedirect('http://www.abayun.cn') 




10、Nginx 301网页跳转代码

if ($host ~ '^itmemo.cn'){ 

    return 301 http://www.abayun.cn$request_uri




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

[关闭窗口] [打 印]
·上一遍文章:如何上传网站,FTP软件下载使用帮助
·下一遍文章:已经没有了
 

备案号:蜀ICP备2023014783号-1  公安备案号:申请中