1、IIS下301配置
Internet信息处事打点器 -> 假造目次 -> 重定向到URL,输入必要转向的
方针URL,并选择“资源的永世重定向”。
2、ASP下的301转向代码
<a target=asp实现301跳转代码" src="http://host.zzidc.com/uploads/allimg/141112/1-141112114341b3.jpg" style="border-top: medium none; height: 263px; border-right: medium none; width: 562px; white-space: normal; word-spacing: 0px; border-bottom: medium none; text-transform: none; color: rgb(51,51,51); padding-bottom: 0px; padding-top: 0px; font: 12px/18px 宋体, Tahoma, SimSun-ExtB; padding-left: 0px; margin: 0px; border-left: medium none; widows: 1; letter-spacing: normal; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.zzidc.com/"
%>
3、ASP.Net下的301转向代码
<a target=asp.net 301跳转代码" src="http://host.zzidc.com/uploads/allimg/141112/1-141112114453T6.jpg" style="border-top: medium none; height: 339px; border-right: medium none; width: 560px; white-space: normal; word-spacing: 0px; border-bottom: medium none; text-transform: none; color: rgb(51,51,51); padding-bottom: 0px; padding-top: 0px; font: 12px/18px 宋体, Tahoma, SimSun-ExtB; padding-left: 0px; margin: 0px; border-left: medium none; widows: 1; letter-spacing: normal; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.zzidc.com/");
}
</script>
4、PHP下的301转向代码
<a target=php 301跳转代码" src="http://host.zzidc.com/uploads/allimg/141112/1-14111211460J41.jpg" style="border-top: medium none; height: 187px; border-right: medium none; width: 558px; white-space: normal; word-spacing: 0px; border-bottom: medium none; text-transform: none; color: rgb(51,51,51); padding-bottom: 0px; padding-top: 0px; font: 12px/18px 宋体, Tahoma, SimSun-ExtB; padding-left: 0px; margin: 0px; border-left: medium none; widows: 1; letter-spacing: normal; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.zzidc.com/");
exit();
5、CGI Perl下的301转向代码
CGI Perl 301跳转代码
$q = new CGI;
print $q->redirect("http://www.zzidc.com/");
6、JSP下的301转向代码
JSP 301跳转代码
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.zzidc.com/" );
response.setHeader( "Connection", "close" );
%>
7、Apache下301转向代码
新建.htaccess文件,输入下列内容(必要开启mod_rewrite):
1)将不带WWW的域名转向到带WWW的域名下
Apache 301跳转代码
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^lesishu.cn [NC]
RewriteRule ^(.*)$ http://www.zzidc.com/$1 [L,R=301]
2)重定向到新域名
Apache 301跳转
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.zzidc.com/$1 [L,R=301]
3)行使正则举办301转向,实现伪静态
Apache 301代码
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^news-(.+)\.html$ news.php?id=$1
1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!
2. 本站不保证所提供下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有积分奖励和额外收入!
无极源码之家 > 建站教程 > 使用技巧 最全的网站301跳转代码合集 https://www.160170.cn/index.php/Teach/587.html


相关文章
预留评论插件