12种实现301网页重定向方法的代码实例
以下是12种实现301网页重定向方法的代码实例:
<meta http-equiv="refresh" content="3; url=http://www.new-url.com/">
Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?>
Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.new-url.com/"
private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url.com"); }
response.setStatus(301); response.setHeader( "Location", "http://www.new-url.com/" ); response.setHeader( "Connection", "close" );
$q = new CGI; print $q->redirect("http://www.new-url.com/");
def old_action headers("Status") = "301 Moved Permanently" redirect_to "http://www.new-url.com/" end
window.location.href='http://www.newdomain.com/';