找回密碼
 註冊
搜索
查看: 3811|回復: 0

更換網址 301 Redirect For Apache

[複製鏈接]
發表於 2011-6-30 14:34:35 | 顯示全部樓層 |閱讀模式
當網站要更換網址時,可以利用修改.htaccess加入以下內容的方式來達到自動轉到新網址
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteCond %{HTTP_HOST} !^newdomain\.com
  4. RewriteRule ^(.*)$ [url]http://www.newdomain.com/[/url]$1 [R=301,L]
複製代碼

可用來測試是否正確設定301導向的網站
http://www.internetofficer.com/seo-tool/redirect-check/

Reference:
http://www.mcanerin.com/en/articles/301-redirect-apache.asp
http://steachs.com/archives/709
http://shachi.tw/301-moved-permanently/



您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-4-19 17:26 , Processed in 0.015812 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表