Confusion:Why allow different product category base and custom product URL base?
-
Hi
I’ve been setting up my store for a while (it being my first WC site), and I have just noticed something which is very confusing and I don’t understand why it is the case.
In WP Settings > Permalinks, WP allows me to type in a ‘Product category base’, which I believe just defaults to ‘product-category’.
However, WP also allows me to set a product URL base. Currently, that is set on ‘custom base’ with /shop/%product_cat%/ as the entry. I cannot recall whether this is the default option, or whether I tinkered with this for some reason ages ago.
The ability to make them different means that if someone visited a product, and wanted to get a category manually, or discern the product category from the URL, they would be wrong and get a 404 error.
For example, go to prouct:
site.com/shop/category-name/product-name
If someone wishes to discern the category url and go there, they will try:
site.com/shop/category-name/
And they would get a 404 error, because the working url structure is different:
site.com/product-category/category-name/
Could someone experienced with WC please explain to me why anyone would want an inbuilt ability to create inconsistent URLs? I would honestly very much appreciate know the reasoning.
What is best practice?
Ultimately I’d just want:
shop.com/category-name/product-name
or
shop.com/shop/category-name/product-name
Is there a best practice for this? I am utterly confused.
Another thing: If I change the custom base and remove the ‘shop’ part, that is going to wreak havoc with all my product links. Can someone please also recommend the best way to handle bulk re-directs within WP/WC without dealing with each link individually? ie. every product that once had ‘shop’ as the base, should now redirect to the url without ‘shop’, etc?
Much appreciated.
- The topic ‘Confusion:Why allow different product category base and custom product URL base?’ is closed to new replies.