网站自动跳转代码大合集
生活随笔
收集整理的這篇文章主要介紹了
网站自动跳转代码大合集
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.HTML方式(可隱藏跳轉(zhuǎn)后網(wǎng)址)
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Panda社區(qū)</title> <frameset framespacing="0" border="0" rows="0" frameborder="0"> <frame name="main" src="http://www.httple.net/" scrolling="auto" noresize></frameset> </head> <body></body> </html>2.HTML跳轉(zhuǎn)
<meta http-equiv="refresh" content="0; url=http://www.httple.net">3.PHP跳轉(zhuǎn)
<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.httple.net"); exit(); ?>4.JavaScript跳轉(zhuǎn)
<script language="javascript"> top.location='http://www.httple.net'; </script>5.Apache(301)跳轉(zhuǎn)
Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.httple.net$1 [R=301,L]6.ASP跳轉(zhuǎn)
<% Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.httple.net" Response.End %>7.ASP.NET(301)跳轉(zhuǎn)
<%@ 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.httple.net); } 8.Perl跳轉(zhuǎn) $q = new CGI; print $q->redirect("http://www.httple.net");9.Pyton跳轉(zhuǎn)
from django import http def view(request): return http.HttpResponseRedirect('http://www.httple.net')總結(jié)
以上是生活随笔為你收集整理的网站自动跳转代码大合集的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 马哥学习笔记二十七——IO复用
- 下一篇: Git本地仓库文件的创建、修改和删除