301页面重定向

asp
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.0371loan.com/News/”
%>
ASP.Net下的301转向代码
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.wdydkw.com/“);
}
</script>
PHP下的301转向代码
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.baidu.com/sss/”);
exit();
CGI Perl下的301转向代码
$q = new CGI;
print $q->redirect(”http://www.baidu.com/sss/”);
JSP下的301转向代码
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.baidu.com/sss/” );
response.setHeader( “Connection”, “close” );
%>
一般设置在默认文件下

你可能感兴趣的:(页面重定向)