顯示具有 心情記事 標籤的文章。 顯示所有文章
顯示具有 心情記事 標籤的文章。 顯示所有文章

2016年3月1日 星期二

[多語言]網頁轉址之[永久/暫時]轉址{Redirect}

PHP


<?php
header("HTTP/1.1 301 Moved Permanently"); // 不使用此行即為暫時轉址{302}
header("Location: http://host.domain.tld/path/to/");
?>

 

 

Client端無法使用永久轉址{301},以下皆為暫時轉址{302}。


HTML


<meta http-equiv=refresh content="0;url=http://dkstu.com/">

 

Javascript


<script language="JavaScript">
window.location.href = "http://dkstu.com/";
</script>