12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
建站问答 时间:2024-12-01 19:10:13
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
域名实现301跳转的方法:通过程序语言在对应的配置文件添加代码,例如:1.ASP的301跳转代码:<%@Language="VBScript"%><%Response.Status="301MovedPermanently"Response.AddHeader
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
域名实现301跳转的方法:
通过程序语言在对应的配置文件添加代码,例如:
1.ASP的301跳转代码:
<%@Language="VBScript"%><%
Response.Status="301MovedPermanently"
Response.AddHeader"Location","http://www.itdcw.com"
%>
2.PHP的301跳转代码:
$the_host=$_SERVER['HTTP_HOST'];//获取主域名$request_uri=isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';//获取后缀
if($the_host!='nanjingseo.org')
{
header('HTTP/1.1301MovedPermanently');
header('Location:http://nanjingseo.org'.$request_uri);
}
3.ASP.Net的301跳转代码:
<scriptrunat="server">privatevoidPage_Load(objectsender,System.EventArgse)
{
Response.Status="301MovedPermanently";
Response.AddHeader("Location","http://www.itdcw.com");
}
</script>
4.CGI Perl的301跳转代码:
$q=newCGI;print$q->redirect("http://www.itdcw.com");
5.JSP的301跳转代码:
<%response.setStatus(301);
response.setHeader("Location","http://www.itdcw.com");
response.setHeader("Connection","close");
%>
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19