saleor / saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.
https://demo.saleor.io/
BSD 3-Clause "New" or "Revised" License
769 stars 672 forks source link

URL without IDs #554

Closed Zyles closed 4 years ago

Zyles commented 4 years ago

Remove /category/ and /product/ in URLs and stop using ID numbers.

Wordpress figured this out 10 years ago, don't bring in bad habits.

URLs should be permanent, unique and have no ID numbers. The system should not need to distinguish a page, category or product using the url. That should be handled by the API router.

Saleor looks promising but there is no way we are 301 redirecting over 10k SKUs to worse URLs than we have today.

Pacu2 commented 4 years ago

I think if you propose such a change in such a mature project, it's on you to prove the point. Your request is not informative, as using subjective adjectives, such as "worse," won't help us to get the full picture. But I'm interested in what you've written.

  1. How can one profit from using "good" URLs over the "bad" URLs? If by "bad" we understand Saleor's and by "good" - Wordpress's.
  2. What's the reasoning behind dropping /product/ and /category/ from the URLs?

If you look at the big brands, several ones are using the same tactics as Saleor does, e.g., eBay, Booking. I wonder how Wordpress's approach is superior to them?

On the other hand, having an ID in URL has its benefits; ID is constant. I f the product's slug changes, it's super simple to redirect the user to the new URL, matching by the ID.

We should not expose our data size and velocity in the URLs, due to business intelligence security, but that's another topic.

Zyles commented 4 years ago

You created an attack vector for malicious duplicate SEO content.

Is that informative enough?

https://demo.saleor.io/product/asodasjdojdajodiasijdo/81/ https://demo.saleor.io/product/sdfdgdgasdffdfsdfsdaf/81/ https://demo.saleor.io/product/sadfasdfwe4fawefaefaefasfsd/81/ https://demo.saleor.io/product/sadfasdfsdfsdfsdf3fsefsef/81/ https://demo.saleor.io/product/2434234rwe234234234234/81/

https://moz.com/learn/seo/duplicate-content

Zyles commented 4 years ago

More issues:

https://demo.saleor.io/product/ returns status code 200 while the page actually says 404

You created a page without any content. And all 404 pages will be the same, and return 200 status code across the page over long term when links get broken and products are taken out of stock.

These will all be indexed by Google.

The urls are hierarchical, but there is nothing at the top content. You may look at this as a small thing.

It also affects the breadcrumbs.

image

Compared to: image

You are also using duplicate content on the categories. Not sure if that is just because it is a demo, but you should write the category name and description uniquely, automatically.

You are using eBay as an example. But it is not really a good one. They are a HUGE company and they do not care about SEO as much as smaller businesses do.

Rather ask yourself the other way around, what value does /category/ and /product/ bring? Can't you do URL mapping to product/category without it?

Pacu2 commented 4 years ago

@Zyles Thanks for pointing this out. All of those were resolved in the "old" version of Saleor, but the storefront is still beta quality and evolving. I have created related issues.

Dropping "category" or "product" is a matter of preference, I suppose.

NyanKiyoshi commented 4 years ago

We could use JSON-LD for that, for example newegg does that:

{

    "@context":"http://schema.org",
    "@type":"BreadcrumbList",
    "itemListElement":[
        {
            "@type":"ListItem",
            "position":1,
            "item":{
                "@id":"https://www.newegg.com/",
                "name":"Home"
            }
        },
        {
            "@type":"ListItem",
            "position":2,
            "item":{
                "@id":"https://www.newegg.com/Components/Store/ID-1",
                "name":"Components"
            }
        },
        {
            "@type":"ListItem",
            "position":3,
            "item":{
                "@id":"https://www.newegg.com/Fans-PC-Cooling/Category/ID-11",
                "name":"Fans & PC Cooling"
            }
        },
        {
            "@type":"ListItem",
            "position":4,
            "item":{
                "@id":"https://www.newegg.com/Water-Liquid-Cooling/SubCategory/ID-575",
                "name":"Water \/ Liquid Cooling"
            }
        },
        {
            "@type":"ListItem",
            "position":5,
            "item":{
                "@id":"https://www.newegg.com/d/NZXT-Water-Liquid-Cooling/BrandSubCat/ID-2120-575",
                "name":"NZXT"
            }
        }
    ]
}

That is a possibility. It is well handled by Google.

The e-commerce website that I know/use are all using the structure something/<name> (category, page, etc.); it never bothered me (some are actually awful, like for example topachat.com showing on Google: pages/detail2_cat_est_telephonie_puis_rubrique_est_wt_smartp_puis_ref_est_tl11003300.html); it actually makes it more readable (to my eyes)–but as @Pacu2 said, that's a question of taste. SEO-wise, JSON-LD can easily be an answer for better SEO.

Right now, we are still yet to only have one kind of product architecture, (improved) collections instead of categories for more flexibility. Once we only have one kind, it will allow easy customization.

NyanKiyoshi commented 4 years ago

Tracking tickets:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.