ssl-guides 2026-12-02 ⏱ 1 min read

HTTPS 跳转检测

HTTPS 跳转检测

跳转错误是 HTTPS 迁移里最安静的杀手。跳转链会稀释链接权重,死循环会让整个站点打不开,该用 301 的地方用了 302,等于告诉搜索引擎这次搬迁是临时的。跳转检测工具能显示域名每种写法的真实结果,让你去修链,而不是靠猜。

正确配置长什么样

下面四个地址,每一个都应该只返回一次 301,指向同一个规范 HTTPS 地址:

http://example.com        -> https://example.com
http://www.example.com    -> https://example.com
https://www.example.com   -> https://example.com

一步,永久,没有例外。统一到 www 还是不带 www 由你决定;关键是所有写法一步到位。

HTTPS 跳转检测:检查你的跳转

最快的检查是我们的 HTTPS 跳转工具,任何地址都能看到完整链条。命令行里 curl 做的是同一件事:

curl -sI http://example.com | head -n 3
curl -sIL http://www.example.com | grep -E "HTTP|location"

加上 -L 参数会跟随整条链,每一步都能看到。看状态码,再数 location 行数:多于一行就是一条链。

HTTPS 跳转检测:能查出什么

症状原因修法
两次或更多跳转规则先把 HTTP 跳到 www,再把 www 跳到 HTTPS改成一条规则,直接跳到规范 HTTPS 地址
该 301 却用了 302迁移后留下的临时跳转改成永久 301
跳转死循环服务器强制 HTTPS,而 CDN 用 HTTP 和它通信(Flexible SSL)用 Full (Strict) 模式和真实的源站证书
所有地址都跳到首页通配规则把路径丢了在规则里保留 $request_uri 或等价写法
HTTP 返回 200完全没有跳转规则加一条;重复内容会伤 SEO

能用的服务器规则

Nginx:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

Apache(.htaccess):

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [R=301,L]

这个 HTTPS 跳转生成器 会按你的服务器和统一写法生成对应的片段。

别忘了后面的 HSTS

跳转稳定几周之后,HSTS 会让浏览器彻底跳过 HTTP,回访用户就不再经过跳转。先用较短的 max-age,确认没东西坏掉再延长。用 Security Headers Checker.

相关阅读: 修复跳转死循环, 开启 HSTS, 迁移后更新 Search Console 和 HTTPS 检测工具.

常见问题

HTTPS 用 302 什么时候是对的?

只在测试时。永久迁移用 302 会让搜索引擎继续收录旧地址。确认没问题后立刻换成 301。

我的站点在 HTTP 和 HTTPS 之间来回跳。哪里错了?

通常是 Flexible 模式下的代理:CDN 用 HTTP 连你的服务器,服务器强制 HTTPS,循环就开始了。要改代理的 SSL 模式,不是改跳转。

深层地址要跳到首页吗?

永远不要。每个旧地址应该映射到它自己的 HTTPS 版本。全都跳首页既让用户烦,也浪费页面的排名信号。

大规模怎么检查跳转?

从 Search Console 或 sitemap 导出主要地址,用 curl -sIL 循环跑一遍。需要多于一次跳转的地址都进修复清单。

↪️ Generate .htaccess & Nginx 301 HTTPS Redirects
Generate 301 Rules →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

免费 SSL 证书签发、在线 SSL 检测与 CSR 生成器

无需复杂服务器配置,60 秒快速获取 Let's Encrypt 与 Buypass 信任的 HTTPS 证书。

Related Articles

🤖 TryFreeSSL AI Assistant