UrlEdge
回到博客
2026年5月17日 UrlEdge Editorial3 min read

www、apex 与 wildcard forwarding:怎样不破坏 SEO

host normalization 看起来简单,但当 root、www、subdomain、path 和 query string 各自有不同规则时,redirect chain 很快就会出现。先定 canonical host 才是关键。

apex、www 和 wildcard subdomain 汇聚到一个 canonical host 的 host normalization map

host normalization 看起来像一个小小的 DNS 任务。可是一旦进入 migration 或 rebrand,它很快就变成 URL policy 的问题。

品牌想用 apex domain。旧站还在用 www。产品、docs 或 campaign 可能在 subdomain 上。agency 会把 wildcard forwarding 写进迁移表。广告链接还需要保留 path 和 UTM。把这些决策分开做,最后往往就是 redirect chain。

关键问题不是 www 和 apex 哪个永远更好。关键问题是:哪个 host 应该是 canonical,以及其他 variant 要怎么跟过去。

如果这是更大迁移的一部分,请先看 Website Migration Redirect Checklist。这篇只聚焦 host layer。

host 也是 URL policy 的一部分

example.comwww.example.com*.example.com 在操作上并不相同。

  • apex 在 marketing 上往往更简洁。
  • www 在旧 stack 里很常见。
  • subdomain 可能是 product、docs、support 或 store。
  • wildcard 适合很多 host 都走同一条 rule 的场景。

重要的是不要让这些 variant 靠运气运行。

Host normalization map for apex, www, and wildcard subdomains

在 launch 前先选好 canonical host

提前回答这些问题:

问题为什么重要
网站是在 apex 还是 www决定用户看到的 canonical URL
哪些 subdomain 是 alias不是每个 subdomain 都该合并
path 是否要保留SEO、bookmark 和 deep link 都依赖它
query string 是否要保留UTM、coupon 和 ID 可能会丢
是否有临时例外campaign 和 launch 可能需要不同规则

如果这些答案不清楚,多个 layer 就会同时试着“帮忙”。

DNS 不会解决全部问题

DNS 只是告诉 traffic 去哪,不会自动决定可见 URL 的变化。

清晰的流程:

http://www.old-brand.example/pricing?utm_source=email
  -> https://new-brand.example/pricing?utm_source=email

脆弱的流程:

http://www.old-brand.example/pricing
  -> https://www.old-brand.example/pricing
  -> https://old-brand.example/pricing
  -> https://new-brand.example/pricing

单次 hop 更容易测试,也更容易维护。

Wildcard forwarding 适合结构仍然对齐的情况

如果 path 结构变化不大,wildcard rule 很有用。

old.example.com/* -> new.example.com/$1

适用场景:

  • 需要保留大量旧 URL
  • path 结构变化很小
  • 不想给每个页面写一条 rule
  • 旧 subdomain 真的是 alias

如果信息架构变化很大,重要 URL 仍然需要明确 mapping。

保留 path 和 query

改 host 不等于删掉 request context。

http://old.example.com/docs/api?ref=partner&utm_source=newsletter

如果结构允许,最终应该到:

https://new.example.com/docs/api?ref=partner&utm_source=newsletter

这对以下场景很重要:

  • SEO page
  • documentation
  • paid campaign
  • affiliate link
  • 用户保存的 bookmark

path 或 query 消失后,redirect 可能看起来正确,但价值已经丢了。

避免 chain

最常见的错误是把责任分散:

  • HTTP 到 HTTPS 在一层
  • www 到 apex 在另一层
  • domain migration 在 CDN 或 hosting
  • app 又加了一条 canonical rule

最终就变成 http -> https -> www -> final

如果你的 stack 已经这样,下一步请看 Redirect Chains and Loops

做 launch matrix 测试

发布前测试真实变体。

TestExample
Apex roothttps://example.com/
www roothttps://www.example.com/
Deep pathhttps://example.com/pricing
Deep path with queryhttps://example.com/pricing?utm_source=email
Old host with pathhttps://old.example.com/blog/post-1
Wildcard subdomainhttps://docs.example.com/guide

Launch QA matrix for canonical host, path preservation, query preservation, and redirect hops

确认这些项:

  • final host 正确
  • path 保留
  • query 保留
  • status code 符合意图
  • 没有额外 hop

UrlEdge 适合放在哪

UrlEdge 适合把 host normalization 当成 routing policy 管理,而不是散落在 snippet 里。

价值在于有一个地方负责 canonical host、variant、path、query 和 status code。

FAQ

一定要用 apex 代替 www 吗?

不一定。两者都可以。关键是选一个 canonical host,并让其他 variant 清晰跟随。

可以用一条 rule 处理 wildcard subdomain 吗?

可以,只要结构仍然对齐。如果变化很大,重要 URL 还是要显式 mapping。

只靠 DNS 可以吗?

不可以。DNS 不能替代用户可见的 HTTP redirect policy。

campaign 参数要保留吗?

通常要,除非有明确理由删除。丢失 attribution 很难再找回。

参考

先把 canonical host 定下来

把 root、www、wildcard subdomain 和自动 HTTPS、path preservation 一起管理。

试试 Free Redirect Service

相关文章

查看全部