# 网址缩短

**网址缩短**是将一个长网址映射到服务商自有域名下的短码，并将每位访客重定向至原始目标地址的做法。缩短服务的核心是一个将短码映射到长网址的数据库，外加一台在查询时通常返回301或302重定向的Web服务器。<sup>[1](https://trystlink.io/blog/how-url-shorteners-work)</sup> 其目的是让链接适应受限或不方便的场合——从社交媒体帖子、印刷媒体到二维码——并在此过程中收集点击统计。不应假定任何短链接是永久有效的：其可用性取决于供应商账户、订阅、域名所有权、服务商政策以及持续运营。<sup>[2](https://www.itechguides.com/top-short-url-tools-for-quick-and-effective-link-management-in-2024-updated-comparison/)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心机制 | 数据库将短码映射到长网址；服务器通常以HTTP 301或302重定向响应每次查询<sup>[1](https://trystlink.io/blog/how-url-shorteners-work)</sup> |
| 代码空间 | 对自增ID进行Base62编码，从构造上即无碰撞；7个字符可提供62<sup>7</sup> ≈ 3.5万亿个唯一代码<sup>[1](https://trystlink.io/blog/how-url-shorteners-work)</sup><sup> • </sup><sup>[3](https://betterengineers.substack.com/p/how-to-design-a-url-shortener-at)</sup> |
| 压缩效果 | 一个bit.ly短网址（如http://bit.ly/dLbCeC）为20个字符<sup>[4](https://www.ieee-security.org/TC/W2SP/2011/papers/urlShortening.pdf)</sup> |
| 重定向选择 | 301重定向可能被浏览器缓存，因此重复点击可能不被计数；部分服务使用302以准确计数，下文所讨论的来源对SEO效果的描述各不相同<sup>[5](https://cutt.ly/resources/blog/what-is-url-shortener)</sup> |
| 安全 | 2025年一项研究发现，四分之一的专用缩短服务易受误导攻击<sup>[6](https://www.ndss-symposium.org/wp-content/uploads/2025-927-paper.pdf)</sup> |
| 链接死亡率 | 在2026年的一项抽样中，507个tinyurl.com链接中有36%、356个goo.gl链接中有33%、470个bit.ly链接中有26%已失效<sup>[7](https://whooshly.co/blog/link-rot-short-links)</sup> |
| 定价 | Bitly的入门付费档（Core）为每年计费每月10美元；其免费档每月允许5个短链接和3个自定义后半段<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup><sup> • </sup><sup>[9](https://bitly.com/pages/products/url-shortener)</sup> |

## 工作原理

当用户创建短链接时，服务存储目标网址并返回一个其自有域名下的短地址。此后每次访问都会触发重定向；当其为HTTP重定向时，服务器发送一个状态码以3开头的响应，并附带一个包含目标网址的`Location`头。<sup>[10](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)</sup> 解析通常通过[HTTP 301](https://www.edgepedia.org/zh/http-301)或302状态消息，或[JavaScript](https://www.edgepedia.org/zh/javascript)、HTML元标签等客户端机制完成，服务同时记录访问并生成汇总统计。<sup>[11](https://archives.iw3c2.org/www2014/proceedings/proceedings/p51.pdf)</sup>

**短码生成。** 大多数专业缩短服务通过对自增数据库ID进行Base62编码来生成短码，使用数字、小写字母和大写字母。这样产生的紧凑标识符保证唯一，因此不会发生碰撞：ID 100,000编码为`Q0u`，十亿的ID只需六个字符。<sup>[5](https://cutt.ly/resources/blog/what-is-url-shortener)</sup><sup> • </sup><sup>[1](https://trystlink.io/blog/how-url-shorteners-work)</sup> 7个字符的空间可容纳62<sup>7</sup> ≈ 3.5万亿个网址；Base64会引入URL不安全的`+`和`/`字符。<sup>[3](https://betterengineers.substack.com/p/how-to-design-a-url-shortener-at)</sup> 代价是可猜测性：顺序代码让任何人都能通过抓取`aB3xK1`、`aB3xK2`、`aB3xK3`来遍历数据库，而在极端规模下单一计数器会成为写入热点。<sup>[3](https://betterengineers.substack.com/p/how-to-design-a-url-shortener-at)</sup>

**重定向状态码。** 301（永久移动）响应表示原始网址不应再被使用；搜索引擎机器人、RSS阅读器及其他爬虫会更新该资源的原始网址。302（找到）表示临时重定向；爬虫通常不将其视为永久替换。307（临时重定向）的创建是为了消除302在非GET方法下行为的歧义，308则永久保留方法和请求体。<sup>[10](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)</sup> 这一选择对分析有实际影响：由于浏览器可能缓存301重定向，同一用户两次点击同一短链接可能不会产生两条点击记录，因此部分服务使用302以更准确地统计点击；下文所讨论的来源对SEO效果的描述各不相同。<sup>[5](https://cutt.ly/resources/blog/what-is-url-shortener)</sup> Bitly返回301，并声明不会重复使用或修改短链接，因此其重定向是永久的。<sup>[12](https://support.bitly.com/hc/en-us/articles/230897368-How-does-a-shortened-link-work)</sup>

**点击日志。** 分析在重定向期间触发，异步记录时间戳、基于IP的地理位置和基于用户代理的设备类型。<sup>[1](https://trystlink.io/blog/how-url-shorteners-work)</sup> 仪表板通常展示总点击量、独立点击量、设备类型、操作系统、浏览器、国家级聚合以及来源页面。<sup>[5](https://cutt.ly/resources/blog/what-is-url-shortener)</sup> 点击计数可能与目标平台上的会话数不同，原因包括机器人过滤、隐私保护、广告拦截器、重定向处理、Cookie限制、重复点击以及跨域归因。<sup>[2](https://www.itechguides.com/top-short-url-tools-for-quick-and-effective-link-management-in-2024-updated-comparison/)</sup>

## 历史

网址缩短服务至少早在2001年就已存在；[TinyURL](https://www.edgepedia.org/zh/tinyurl)很可能是第一个广为人知的服务。<sup>[13](https://www.cs.uic.edu/~polakis/papers/www2011.pdf)</sup> 2011年的一项调查发现，在拥有数十家参与者的市场中，只有bit.ly、ow.ly和tinyURL等少数几家服务占据了最大份额。<sup>[13](https://www.cs.uic.edu/~polakis/papers/www2011.pdf)</sup> 推特时代使缩短成为常态，bit.ly公开了每条链接的总点击量和日点击量、来源网站以及访客所在国家的统计。<sup>[13](https://www.cs.uic.edu/~polakis/papers/www2011.pdf)</sup>

最大规模的关停始于谷歌。自2018年4月13日起，匿名用户无法再通过控制台创建新的goo.gl短链接，谷歌于2019年3月30日停用goo.gl控制台，推荐Firebase Dynamic Links、Bitly和Ow.ly作为替代方案。<sup>[14](https://developers.googleblog.com/transitioning-google-url-shortener-to-firebase-dynamic-links/)</sup> 此后行业转向品牌化链接管理平台，将重定向与二维码、链接聚合页和安全扫描捆绑在一起。<sup>[15](https://u2l.ai/blog/what-is-url-shortening)</sup>

## 为何缩短：用例与限制

最初的驱动力是字符压缩。一个bit.ly短网址（如http://bit.ly/dLbCeC）仅由20个字符组成，可将长地址压缩至30个字符以下。<sup>[4](https://www.ieee-security.org/TC/W2SP/2011/papers/urlShortening.pdf)</sup> 在空间视觉成本高昂的场合，短链接也很重要：二维码直接编码网址，每个字符都会使码图增大，因此缩短服务加二维码生成器的工作流在实体宣传活动中变得普遍。<sup>[16](https://urlshorter.cc/blog/url-shortener-history)</sup> 社交资料的字数限制催生了对单条重定向和托管链接页面的需求。<sup>[16](https://urlshorter.cc/blog/url-shortener-history)</sup> 缩短也在可读性与长度之间做取舍：品牌化或描述性的后半段更长，但能告诉读者链接指向何处。

## 数据一览

行业的规模数据主要来自供应商和聚合器来源，阅读时应留意这一局限。一家统计聚合器将2023年全球网址缩短行业收入定为12亿美元，北美占市场份额35%，亚太地区以22.1%的复合年增长率成为增长最快的地区。<sup>[17](https://worldmetrics.org/url-shortening-industry-statistics/)</sup> 定价的记录更为详实：Bitly的入门付费档（Core）为每年计费每月10美元，品牌域名Growth档为每月35美元，而其免费档降至每月5个链接和2个二维码且无分析功能。<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup> 一个对比页面列出的入门付费方案为：Cuttly每月12美元，Bitly每月10美元（仅年付），Rebrandly约每月13至14美元，Short.io每月5美元，TinyURL每月12.99美元，免费方案额度从5个链接（Bitly）到1,000个链接（Short.io）不等。<sup>[18](https://cutt.ly/resources/compare/)</sup> 平台原生缩短的规模可从安全数据中窥见：2017年两个月窗口内发布到推特的超过10,000个唯一黑名单钓鱼和恶意软件网址，从推特用户处获得了超过160万次点击。<sup>[19](https://dl.acm.org/doi/10.1145/3373017.3373019)</sup>

## 安全与滥用

缩短掩盖了目标地址，这既是其功用也是其风险。攻击者可以枚举缩短服务生成的短网址以寻找秘密网址，而请求短网址的用户可能被服务通过Cookie追踪。<sup>[4](https://www.ieee-security.org/TC/W2SP/2011/papers/urlShortening.pdf)</sup> 一项对七年间收集的超过700万条垃圾邮件的研究，识别出了垃圾邮件发送者最常使用的缩短服务及其混淆短网址的方式。<sup>[4](https://www.ieee-security.org/TC/W2SP/2011/papers/urlShortening.pdf)</sup>

**可信域名的滥用。** 2025年一项大规模研究发现，四分之一的专用网址缩短服务易受误导攻击，而这些服务从其用户和基于域名的检查器那里都获得了隐性信任。<sup>[6](https://www.ndss-symposium.org/wp-content/uploads/2025-927-paper.pdf)</sup> 缩短服务域名下的网址还可能携带开放重定向漏洞（CWE-601）和跨站脚本，让攻击者控制可信域名本身的内容。<sup>[6](https://www.ndss-symposium.org/wp-content/uploads/2025-927-paper.pdf)</sup> 平台过滤存在局限：2018至2019年间，发布到推特且发布时未被拦截的黑名单网址中，只有约12%被推特拦截，尽管发布的黑名单网址总量有所下降。<sup>[19](https://dl.acm.org/doi/10.1145/3373017.3373019)</sup>

**广告型缩短服务与沦陷。** 广告型服务——按点击向链接创建者付费——是一种独特的危险：一项研究发现，所有受测服务即使最终目标地址无害，也会生成对恶意域名的Web请求，平均每个短网址产生86.5次对恶意域名的请求，主要指向诈骗注册页面和恶意Web推送通知页面。<sup>[20](https://www.jstage.jst.go.jp/article/ipsjjip/30/0/30_865/_pdf/-char/en)</sup> 缩短服务本身也可能成为故障点：在2009年针对cli.gs的攻击中，攻击者攻陷了后端服务器并更改了220万个短网址的目标地址。<sup>[11](https://archives.iw3c2.org/www2014/proceedings/proceedings/p51.pdf)</sup>

**缓解措施。** 服务商在创建时对照Google Safe Browsing等信誉数据库扫描目标地址，持续重新扫描，并提供预览功能（通常通过在短网址后附加`+`触发），让用户在点击前看到目标地址。<sup>[15](https://u2l.ai/blog/what-is-url-shortening)</sup> Bitly的威胁检测服务在创建时实时扫描链接，其滥用API将识别出的有害网址加入列表，使用户被重定向至信息页面。<sup>[9](https://bitly.com/pages/products/url-shortener)</sup>

## 链接失效与永久性

短链接是一条依赖链：打开它的人依赖于服务商的域名、DNS、TLS证书、应用程序、数据库映射和目标地址全部保持可用。当服务商消失时，散布在帖子、文档、引用和印刷材料中的引用就会断裂，无论原始目标地址是否仍在线。<sup>[16](https://urlshorter.cc/blog/url-shortener-history)</sup><sup> • </sup><sup>[11](https://archives.iw3c2.org/www2014/proceedings/proceedings/p51.pdf)</sup>

实测死亡率相当可观。2026年的一项实证检查发现，抽样的507个tinyurl.com链接中有36%、356个goo.gl链接中有33%、334个ow.ly链接中有32%、470个bit.ly链接中有26%已失效。<sup>[7](https://whooshly.co/blog/link-rot-short-links)</sup> 美国政府于2016年停用了自己的1.USA.gov缩短服务。<sup>[7](https://whooshly.co/blog/link-rot-short-links)</sup> goo.gl事件展示了两个方向：谷歌宣布goo.gl网址在2025年8月25日之后将不再返回响应，并从2024年8月23日起对一定比例的链接显示过渡警告页，<sup>[21](https://developers.googleblog.com/google-url-shortener-links-will-no-longer-be-available/)</sup> 但在2025年8月1日，谷歌修改了方案，保留活跃使用的链接而非全部停用。<sup>[22](https://blog.google/innovation-and-ai/technology/developers-tools/googl-link-shortening-update/)</sup> 运营教训与一般原则一致：不应假定任何短链接是永久有效的。<sup>[2](https://www.itechguides.com/top-short-url-tools-for-quick-and-effective-link-management-in-2024-updated-comparison/)</sup>

## 与其他方案的比较

**托管服务。** Bitly、Short.io、Rebrandly、TinyURL和Cuttly的主要差异在于免费档的慷慨程度、分析和自定义域名支持。Bitly的免费方案不含点击分析，也不含自定义域名，而Short.io的免费方案包含分析并支持最多5个自定义域名；TinyURL的免费方案在链接上投放广告。<sup>[18](https://cutt.ly/resources/compare/)</sup> Bitly声称自定义域名可将点击率平均提高17%，这是供应商为建立信任提供的数据。<sup>[9](https://bitly.com/pages/products/url-shortener)</sup>

**自托管软件。** YOURLS是一组MIT许可的PHP脚本，可以零软件成本运行你自己的缩短服务，将链接和点击数据保留在自己的服务器上，提供API、插件以及包括历史点击报告、来源追踪和地理位置在内的统计。<sup>[23](https://www.trackrev.io/blog/best-bitly-alternatives-2026)</sup> 在自托管选项中，Shlink提供完整的REST API、内置二维码生成、分析、密码保护、链接过期和多域名支持，无需插件；YOURLS需要插件才能支持多域名和二维码，且仅提供基础分析；Kutt缺少内置二维码生成。<sup>[24](https://selfhostwise.com/posts/self-hosted-link-shorteners-in-2026-shlink-vs-yourls-vs-kutt-complete-guide/)</sup> 自托管让你掌控域名、重定向数据和可用性，但将托管、备份、TLS证书、滥用防范、监控、数据库安全和事件响应的责任转移给了你，并且并不自动更便宜或更可靠。<sup>[2](https://www.itechguides.com/top-short-url-tools-for-quick-and-effective-link-management-in-2024-updated-comparison/)</sup>

**平台原生缩短服务。** t.co、fb.me和pin.it作为基础设施而非可购买的服务运作：它们服务于各自平台的流量，不太可能对外开放。<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup>

## 近期发展

**关停与整合。** 除了2025年8月的goo.gl逆转之外，<sup>[22](https://blog.google/innovation-and-ai/technology/developers-tools/googl-link-shortening-update/)</sup> 自2024年1月以来已有四款链接聚合工具关停或宣布关停：Koji、Bento.me（2026年2月）、Tap Bio（2026年4月宣布，2026年10月生效）以及Patreon旗下的kit.co（2026年5月），通知期往往不足一个月。关停后迁移一个聚合页现实上每页需要2至8小时，而且即使提供链接导出，分析历史通常也会丢失。<sup>[25](https://linke.ro/blog/why-link-in-bio-tools-keep-shutting-down)</sup> 与此同时，2020年代中期的缩短服务将边缘网络重定向、内置二维码生成、品牌域名、链接聚合页、深度链接和安全扫描整合到单一平台中。<sup>[15](https://u2l.ai/blog/what-is-url-shortening)</sup>

每次重定向至少记录访客的[IP地址](https://www.edgepedia.org/zh/ip-address)、用户代理、点击时间和来源页面；在欧盟境内，一旦这四项中任何一项可与可识别的个人关联，它们就属于个人数据，因此记录点击成为受《通用数据保护条例》第6、13和32条约束的处理行为。<sup>[26](https://lenkli.com/blog/url-shorteners/url-shortener-guide)</sup> Schrems II裁决（欧盟法院，2020年7月）及随后的CNIL指南使欧盟企业法务团队对美国托管的缩短服务感到不安；欧盟-美国数据隐私框架（2023年）部分解决了该问题但并未彻底消除，推动了欧盟托管服务商的增长。<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup> 浏览器隐私变革——从Safari ITP（2018年）和Firefox ETP到Chrome分阶段实施的第三方Cookie变更——已将链接分析推向无Cookie的服务器端点击追踪。<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup>

**需求驱动因素。** 当前时代的特征是实体宣传活动中的二维码工作流和社交资料限制推动的链接页面，对服务商的评估范围扩展到所有权、导出、滥用响应、隐私和域名信誉。<sup>[16](https://urlshorter.cc/blog/url-shortener-history)</sup>

## 重定向与方案细节

Bitly声明其301重定向不影响目标网站的SEO。<sup>[12](https://support.bitly.com/hc/en-us/articles/230897368-How-does-a-shortened-link-work)</sup> 一份对比指南称301将链接权重传递给目标地址，而302则不传递。<sup>[23](https://www.trackrev.io/blog/best-bitly-alternatives-2026)</sup> Bitly的产品页面列出其免费方案每月5个短链接和3个自定义后半段，<sup>[9](https://bitly.com/pages/products/url-shortener)</sup> 而第三方报道则描述为5个链接和2个二维码且无分析功能。<sup>[8](https://lenkli.com/blog/statistics/state-of-link-management-2026)</sup>

## References

1. [How URL shorteners actually work, Trystlink](https://trystlink.io/blog/how-url-shorteners-work)
2. [Top Short URL Tools for Quick and Effective Link Management in 2024, iTechGuides](https://www.itechguides.com/top-short-url-tools-for-quick-and-effective-link-management-in-2024-updated-comparison/)
3. [How to Design a URL Shortener at Scale, Better Engineers](https://betterengineers.substack.com/p/how-to-design-a-url-shortener-at)
4. [Security and Privacy Implications of URL Shortening Services, IEEE W2SP 2011](https://www.ieee-security.org/TC/W2SP/2011/papers/urlShortening.pdf)
5. [What Is a URL Shortener? (2026), Cuttly](https://cutt.ly/resources/blog/what-is-url-shortener)
6. [Misdirection of Trust: Demystifying the Abuse of Dedicated URL Shortening Services, NDSS 2025](https://www.ndss-symposium.org/wp-content/uploads/2025-927-paper.pdf)
7. [Link Rot: How Long Short Links Really Last, Whooshly](https://whooshly.co/blog/link-rot-short-links)
8. [State of Link Management 2026, Lenkli](https://lenkli.com/blog/statistics/state-of-link-management-2026)
9. [URL Shortener | Bitly](https://bitly.com/pages/products/url-shortener)
10. [Redirections in HTTP, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections)
11. [Stranger Danger: Exploring the Ecosystem of Ad-based URL Shortening Services, WWW 2014](https://archives.iw3c2.org/www2014/proceedings/proceedings/p51.pdf)
12. [How does a shortened link work? Bitly Support](https://support.bitly.com/hc/en-us/articles/230897368-How-does-a-shortened-link-work)
13. [we.b: The web of short URLs, WWW 2011](https://www.cs.uic.edu/~polakis/papers/www2011.pdf)
14. [Transitioning Google URL Shortener to Firebase Dynamic Links, Google Developers Blog](https://developers.googleblog.com/transitioning-google-url-shortener-to-firebase-dynamic-links/)
15. [What is URL Shortening? (2026), U2L](https://u2l.ai/blog/what-is-url-shortening)
16. [A Short History of URL Shorteners, urlshorter.cc](https://urlshorter.cc/blog/url-shortener-history)
17. [URL Shortening Industry Statistics, Worldmetrics](https://worldmetrics.org/url-shortening-industry-statistics/)
18. [URL Shortener Comparison 2026, Cuttly](https://cutt.ly/resources/compare/)
19. [Measuring the Effectiveness of Twitter's URL Shortener (t.co), ACM ACSW 2020](https://dl.acm.org/doi/10.1145/3373017.3373019)
20. [Understanding Security Risks of Ad-based URL Shortening Services, IPSJ Journal of Information Processing, 2022](https://www.jstage.jst.go.jp/article/ipsjjip/30/0/30_865/_pdf/-char/en)
21. [Google URL Shortener links will no longer be available, Google Developers Blog](https://developers.googleblog.com/google-url-shortener-links-will-no-longer-be-available/)
22. [We're updating our plans for goo.gl links, Google blog](https://blog.google/innovation-and-ai/technology/developers-tools/googl-link-shortening-update/)
23. [Bitly Alternatives for 2026: 6 Tools Compared, TrackRev](https://www.trackrev.io/blog/best-bitly-alternatives-2026)
24. [Self-Hosted Link Shorteners in 2026: Shlink vs YOURLS vs Kutt, SelfHostWise](https://selfhostwise.com/posts/self-hosted-link-shorteners-in-2026-shlink-vs-yourls-vs-kutt-complete-guide/)
25. [Why Link-in-Bio Tools Keep Shutting Down (2026), Linkero](https://linke.ro/blog/why-link-in-bio-tools-keep-shutting-down)
26. [URL Shortener: The Complete Guide (2026), Lenkli](https://lenkli.com/blog/url-shorteners/url-shortener-guide)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Titles Mo to Z

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/url-shortening

English original: https://www.edgepedia.org/url-shortening
