大网数据广告活动
网站运营与故障问答

What canonical URL should be used for sub-pages? The sub-page itself, the home page,or something else?

· 52CE 我爱测

I was wondering what canonical url to use for my site's pages other than the home page. For example, if I have https://example.com/page-1 , which should I use: https://example.com/page-1 https://example.com Something else entirel…

问题原文

原帖链接 · Zebda · CC BY-SA 4.0

I was wondering what canonical url to use for my site's pages other than the home page.

For example, if I have https://example.com/page-1, which should I use:

  • https://example.com/page-1
  • https://example.com
  • Something else entirely?

I see various examples in sites I visit online, and wanted to know which would be best to use.

已采纳解答

原帖链接 · jrtapsell · CC BY-SA 4.0

What does canonical URL say

Canonical URL says that although there may be multiple URLs with this content, you should treat the canonical one as the URL of this page.

Which should I use for /page-1

If you would only want one of the pages to come up when you are searching, because they are identical, or near identical, then you should use the same canonical URL, otherwise use different ones.

Uses for canonical URL

In a lot of these cases redirects could be used instead, and are usually preferable.

  • Setting if http or https shows in searches
    • https://www.example.com vs http://www.example.com
  • Setting if www should be used or not
    • www.example.com vs example.com
  • Pages that can be accessed multiple ways
    • www.example.com/blue-widget vs www.example.com/?q=blue-widget

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。