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

Will having product ID in URLs hurt SEO compared to a URL with only keywords?

· 52CE 我爱测

Say I have a web shop with a product (optimus-prime), in a category (superheros) such that it has the URL: www.example.com/superheroes/optimus-prime Now I want to prepend the product ID (99) to the product name in the URL, so tha…

问题原文

原帖链接 · GeniusDesign · CC BY-SA 3.0

Say I have a web shop with a product (optimus-prime), in a category (superheros) such that it has the URL:

www.example.com/superheroes/optimus-prime

Now I want to prepend the product ID (99) to the product name in the URL, so that the URL becomes:

www.example.com/superheroes/99-optimus-prime

In regards to SEO, specifically Google search rankings, does it make any notable difference when using one product URL over the other?

As a programmer, I prefer using the URL with the ID in it because it makes system alias generation 100% fail safe for CMS routing purposes.

已采纳解答

原帖链接 · Will Crawford · CC BY-SA 3.0

How

  • Include the id in a sensible place. Easiest is have .../product/$id/name-of-product etc.
    • works with pretty much every routing system, no regexes
  • Add a <link rel=canonical> (or however you spell it, it’s a while since I had to do this) to a url with just the id ¹
  • When handling requests, if the url doesn't have the correct text then do a redirect to the url with the current correct text in.

Why

  • When you (inevitably) have to change the text for some product:

    • Google will see old and new versions as the same page / entity / product
    • old uncorrected links will still “work” (and be redirected to new ones)
    • this applies to incoming links from other sites, too, so you don’t lose your “Google sauce” (or whatever the cool kids are calling it these days)
  • When (almost inevitably) you have multiple products with the same name (especially if you have a popular item that gets “updated” or “restyled” etc.) but different IDs, both can have a link that works (might help you sell off the old stock)
    • you can always add a link to the “new” product on the “old” one’s page

Typoes are inevətəble. If they want to count on keeping product names unique, and never having them corrupted by double-UTF8-encoding or whatever, tell them they get to keep both pieces. Including going through the 404s in the webmaster tools …

¹ This isn’t essential, since a link with the “wrong” text in will redirect anyway. As long as it does have the id in it, it’s more-or-less unbreakable.

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

资料来源与适用范围

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

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

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