HTTP to HTTPS
HTTPS 是基本信任訊號。要用 301/308 統一、更新內鏈與 canonical,避免混合內容與雙版本索引。
定義
把網站從 HTTP 升級到 HTTPS 能提升安全與信任。SEO 上的重點是:確保所有 HTTP 版本永久轉址到 HTTPS,並更新 canonical、hreflang、sitemap 與內鏈,避免搜尋引擎同時看到兩個版本。
為什麼重要
- HTTPS 是使用者與搜尋引擎的基本信任訊號
- Google 明確表示 HTTPS 是排名因素(輕量但必備)
- 避免 HTTP/HTTPS 雙版本造成重複內容與權重分散
- 混合內容(mixed content)會讓瀏覽器顯示安全警告
- 現代瀏覽器會標記 HTTP 網站為「不安全」
- 許多新功能(Service Worker、Geolocation)只在 HTTPS 上可用
- 使用者對 HTTPS 的信任感影響轉換率
怎麼做(實作重點)
- 取得 SSL/TLS 憑證(Let's Encrypt 免費、Cloudflare 自動)
- 把所有 HTTP URL 用 301/308 永久轉址到 HTTPS
- 更新 canonical、hreflang、sitemap、內鏈為 HTTPS 版本
- 檢查並修復 mixed content(圖片、CSS、JS 也要 HTTPS)
- 在 Google Search Console 新增 HTTPS 版本
- 更新外部連結與社群媒體上的 URL(如可能)
- 監控一段時間確認索引與流量正常轉移
範例
html
# Cloudflare Dashboard 設定
# SSL/TLS → Edge Certificates → Always Use HTTPS: ON
# 或用 Page Rules:
# Match: http://*example.com/*
# Setting: Always Use HTTPShtml
# nginx.conf
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/ssl/certs/example.crt;
ssl_certificate_key /etc/ssl/private/example.key;
# HSTS (強制 HTTPS)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}相關連結
教學
常見問題
關於這個詞彙的常見問答。