Would using products?category=category_slug instead of products/{category} affect SEO? Which would be better for SEO? I'm am trying to avoid the latter as it would need custom routes for the crud as oppossed to the default /products -get -post and /products/{product} -get -post -delete.
@gych What if an admin can add sub categories dynamically such that you get a tree structure like:
mens > shoes > sneakers.
In this case I can use a route like /products/{category}.../{nth category}. However, since the category is added dynamicly it is more practicall to just have /products/{category}. How does this affect the seo?
@Udev Its better to use products/mens/shoes/sneakers because those categories are relevant to the page which is good for SEO.
Also when you have a main category for women that uses the same sub categories this will cause issues if you don't add the main category + subcategories to the url
products/women/shoes/sneakers
Assuming the categories can have multiple levels set dynamically by the user, I don't think it is practical to define routes for this, unless I limit the admin to something like 3 levels of sub-categories.
Also if I have same name sub-categories I can generate a numbered slug, i.e.,
1.mens > shoes > sneakers products/sneakers
2.womens > shoes > sneakers products/sneakers-1
Some sites have something like products/mens-shoes-sneakers/ while sites like amazon don't have the category as a parameter but instead in the query.
Also noticed that amazon has a "breadcrumb" component on the page listing the current directory tree. Can this help with SEO instead of having categories as a parameter in the url.
@Udev Yes I can imagine that it would become difficult to use descriptive URL's if the amount of subcategories is not known upfront. Therefore you can still go with a query url if descriptive url's will be to hard to maintain.
If you make sure that your page has good content, keywords, product description, meta tags, html structure, breadcrumbs, alt tags, structured data schema, and page speed, etc. your page will propably still have a good score.