Redirect checker
Follow a URL's redirects hop by hop: the status of each one, where it points, how long it took and the headers it sent.
跳转链检测
逐跳跟踪一个 URL 的跳转:每一跳的状态码、指向哪里、耗时多久,以及返回的响应头。
What the checker shows
- Every hop: The status code, the Location it points to and the time to answer, until a page that does not redirect.
- The end of the chain: The final URL and its status, or why the chain stopped: a loop, more than 10 hops, or an address that may not be opened.
- Headers: Caching, CDN and security headers of each hop, to see which layer sent the redirect.
- Warnings: A hop from https back to http, temporary redirects and chains longer than they need to be.
Common redirect problems
- Too many hops: http://example.com → https://example.com → https://www.example.com is two hops. Send the first one straight to the final URL.
- https to http: A hop back to http exposes the request and is blocked by HSTS. Fix the rule or the app setting that builds the http URL.
- Temporary instead of permanent: A move that will not be undone should be 301 or 308, so search engines move rankings to the new address.
- A loop: Check which layer sends each hop with the server and cache headers, then remove one of the two rules.
Keep important redirects in place
Old links, short links and http to https rules break quietly: the old address starts answering 404, or points to the wrong page. An OpenUptime HTTP monitor can expect the redirect status and its Location, and alerts you when either changes.
Questions
What is the difference between 301, 302, 307 and 308?
301 and 308 say the move is permanent, so browsers and search engines remember the new address. 302 and 307 say it is temporary, so they keep asking the old one. 307 and 308 also keep the request method and body, which matters for a POST; 301 and 302 may turn it into a GET.
How many redirects are too many?
Browsers give up after about 20, and this checker stops after 10. Every hop costs another round trip before the page starts to load, so aim for one: straight from the address people type to the final URL.
What causes a redirect loop?
Usually two layers that disagree: a CDN that talks to the origin over http while the origin sends everything to https, or a www rule on the server and the opposite rule at the DNS host. Each sends the request back to the other.
Which headers are shown?
Location, caching headers (cache-control, age, etag, last-modified, vary), CDN headers (cf-cache-status, x-cache, via), server, content-type and length, and the security headers HSTS, x-frame-options and x-content-type-options. Cookies and other headers are not shown or kept.
Can I be alerted when a redirect breaks?
Yes. An HTTP monitor can expect a redirect status such as 301 and the Location it must point to. It fails when the redirect is removed, changes its status, or starts pointing somewhere else, which often happens after a migration or a CDN rule change.
检测结果包含什么
- 每一跳: 状态码、指向的 Location 和响应时间,直到遇到不再跳转的页面。
- 跳转链的终点: 最终 URL 和它的状态码,或者跳转链停止的原因:循环、超过 10 跳,或不允许访问的地址。
- 响应头: 每一跳的缓存、CDN 和安全相关响应头,用来判断是哪一层发出的跳转。
- 提醒: 从 https 跳回 http、使用临时跳转,以及跳转次数多于必要的情况。
常见的跳转问题
- 跳转次数太多: http://example.com → https://example.com → https://www.example.com 是两跳。让第一跳直接指向最终 URL。
- 从 https 跳回 http: 跳回 http 会暴露请求内容,还会被 HSTS 拦截。修改生成 http 地址的规则或应用设置。
- 用了临时跳转: 不会撤回的迁移应该使用 301 或 308,搜索引擎才会把排名转到新地址。
- 跳转循环: 用 server 和缓存相关的响应头判断每一跳由哪一层发出,然后删掉其中一条规则。
让重要的跳转一直有效
旧链接、短链接和 http 到 https 的规则常常悄悄失效:旧地址开始返回 404,或指向错误的页面。OpenUptime 的 HTTP 监控可以设置期望的跳转状态码和 Location,任何一项变化都会提醒你。
常见问题
301、302、307 和 308 有什么区别?
301 和 308 表示永久迁移,浏览器和搜索引擎会记住新地址;302 和 307 表示临时跳转,它们会继续请求旧地址。307 和 308 还会保留请求方法和请求体,这对 POST 很重要;301 和 302 可能会把它变成 GET。
跳转多少次算太多?
浏览器大约在 20 次后放弃,这个工具在 10 次后停止。每多一跳,页面开始加载前就多一次往返,所以最好只跳一次:从用户输入的地址直接到最终 URL。
跳转循环是怎么造成的?
通常是两层设置互相冲突:CDN 用 http 回源,而源站把所有请求跳转到 https;或者服务器上设置了加 www 的规则,DNS 服务商那里却设置了相反的规则。两边把请求来回推给对方。
会显示哪些响应头?
Location、缓存相关的头(cache-control、age、etag、last-modified、vary)、CDN 相关的头(cf-cache-status、x-cache、via)、server、content-type 和长度,以及安全相关的 HSTS、x-frame-options 和 x-content-type-options。Cookie 和其他头不会显示,也不会保存。
跳转失效时能收到提醒吗?
可以。HTTP 监控可以设置期望的跳转状态码(如 301)以及它必须指向的 Location。当跳转被删除、状态码改变或指向别处时,检测就会失败,这在迁移或修改 CDN 规则之后很常见。