Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
常用轉頁語法(301) – unethost無限空間虛擬主機 技術分享部落格

常用轉頁語法(301)

我們收集了來自網路上常用的轉頁語法,以供大家使用:

1. html 的轉頁語法(最常用):

請直接將下列語法,修改完後,貼到空白的 index.html裡:

<meta http-equiv="refresh" content="填入秒數; url=填入網址“>

範例:

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

 

 

2.  JavaScript :

<script language="JavaScript">
<!--
  window.location.href = "填入網址";
//-->
</script>

 

 

3.  php :

請將語法擺在空白的 index.php檔裡

<?php
  header("Location: 填入網址");
?>

其中php還有301語法(這是對搜索引擎友善)

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: 填入網址");
?>

 

 

4. apache rewrite ( .htaccess ) :

這邊有介紹更詳細的用法
線上產生器
更進階的使用