添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

Webmasters Stack Exchange is a question and answer site for webmasters. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm faced with a decision with creating my paths and not sure which would have the best ranking approach.

  • example.com/product/[slug]-[uuid]
  • example.com/product/[uuid]-[slug]
  • example.com/product/[slug]
  • example.com/product/[uuid]
  • The argument for putting the uuid first or only is it's a deterministic path and it never changes.

    The argument for slug is human readable urls are supposed to rank better but our slugs might change.

    Would a canonical url's approach be different?

    Universally unique IDs (UUIDs) are usually very long, too long for URLs. Is there are reason you can't use a shorter locally unique ID to make your URLs shorter? Stephen Ostermiller Mar 18, 2021 at 19:54 I am assuming you mean a numeric id and not an actual uuid. If so, I would go with /product/slug/id. I would expect that if the DB reaches a large enough size, you would rather search for products based on a numeric ID than a string. StephenCollins Mar 18, 2021 at 20:35

    Number 3 - just the slug will likely give you a (marginal) SEO advantage over the other options, all else being equal. To the extent that canonical implies "authorative & original address" the URaL makes little difference - but again a slug is likely easier to remember.

    Id suggest the only reason to use a UUID over a slug us if you have large swaithes of content or lots of similar content.

    The ID can be very important in URLs for SEO in two cases: 1. If the slug is long enough that it is likely to get truncated. Then having the ID can help recover and redirect. 2. If the slug for a page can change (for example if it is computed from an editable page title). Then the ID is important for implementing redirects. Stephen Ostermiller Mar 18, 2021 at 19:58 @StephenOstermiller you raise good points. I think our definition of a slug is differs - I don't think a slug can change, as it is not something that is updated from an editable page - rather it is a unique identifier of the page which includes meaning understandable to humans. In Wordpress for example a slug is initially derived from the title, but even if you change the title - or even all the contents of the page, the slug remains the same. davidgo Mar 18, 2021 at 21:17

    Thanks for contributing an answer to Webmasters Stack Exchange!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .