隨著各大 DNS 服務商停止提供免費 URL 轉發服務,且搜尋引擎將 example.com 與 www.example.com 視為兩個獨立站點,在 IIS 中正確配置 301 永久重導向成為 SEO 與流量整合的必修課。本文提供兩種場景的圖文級實作步驟。
E:\wwwroot\301web)index.html 或 404.htm 佔位example.com),不含 wwwhttps://www.example.com| 「確切 URL」選項 | 輸入 example.com | 輸入 example.com/path/page.html |
|---|---|---|
| 未勾選 (推薦) | www.example.com | www.example.com/path/page.html ✓ 保留路徑 |
| 勾選 | www.example.com | www.example.com ✗ 丟失路徑 |
若舊域名 old.com 已運營許久,欲將所有內頁權重 301 傳遞至 new.com 對應路徑:
$S$Q 變數https://www.new.com$S$Q$S:將原請求 URL 中被重導向部分「之後」的路徑傳遞至新 URL(如 /article/123.html)$Q:保留原請求的 Query String(含 ?,如 ?id=123&sort=desc)組合效果:old.com/article/123.html?src=seo → new.com/article/123.html?src=seo 完美映射。
httpstatus.io、redirect-checker.org)批次驗證關鍵頁面。web.config (IIS 7+) 實現同等功能。A→301→B→301→C,直接導向最終目標。