生意發軟件
posted on 2011-07-05 16:58 328yxsoft 閱讀(1473) 評論(1) 編輯 收藏 引用
如果可以改 .htaccess,那就用 Rewrite: RewriteEngine On RewriteCond %{http_host} ^xxx.yyy RewriteRule ^(.*)$ http://www.xxx.yyy/$1 [R=301] 不然,在頁面里實現。先判斷當前域名是否為 xxx.yyy,如果是,則—— PHP: header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.xxx.yyy/..."); // “...”部分是頁面路徑 ?> ASP: <% Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://www.xxx.yyy/..." '“...”部分是頁面路徑 Response.End %> 回復 更多評論
Powered by: C++博客 Copyright © 328yxsoft