Georg Keferböck
08/21/2022, 3:25 PM<http://domain.com/t/[taxonomie]/[taxon_1]/[taxon_2]|domain.com/t/[taxonomie]/[taxon_1]/[taxon_2]>
..
Example: <http://mydomain.com/t/dog/food/dry|mydomain.com/t/dog/food/dry>
Product landing page: domain/products/[product_slug]?taxon_id=[id]
Example: <http://mydomain.com/products/eden-80-20-original-cuisine|mydomain.com/products/eden-80-20-original-cuisine>
My clients' previous store has super SEO and user-friendly URLs. They rank well. Ideally, I'd like to keep the same URL structure, but slight deviations are okay, as we will 301 redirect them if required!
Change 1) - When it comes to Taxonomies / Category URLs, is there a way to get rid of the "`/t/`" in the URL, which I suppose stands for "taxonomies" and is a namespaced/scoped so as not to break the routing. But if I bear that in mind and make sure taxonomies are unique and do not interfere with any other namespace, scope and URL.
For example: instead of "`mydomain.com*/t/*dog/food/dry`", we prefer "`mydomain.com/dog/food/dry`"
Change 2) - Each product has only one (1!) taxonomy attached to it. So a product can not have multiple taxonomies/taxons assigned. Therefore we would like to remain SEO friendly and have the taxons as part of the product landing page URL.
For example: instead of "`mydomain.com/products/eden-80-20-original-cuisine`", we would like the URL to be "`mydomain.com/dog/food/dry/eden-80-20-original-cuisine`"
Does anyone know if I can do that, and if so, how? Any help is appreciated! Thank you!elia
08/23/2022, 9:59 AM/t/
you need to add a catch all with a constraint, something like:
get '/*taxon', to: 'spree/products#index', constraints: ->(req) {
Spree::Taxon.exists?(permalink: req.path.slice(1..))
}
and then ini the products controller you need to filter products by the taxon permalink you have in params[:taxon]
Georg Keferböck
08/27/2022, 10:17 AMGeorg Keferböck
08/27/2022, 10:17 AMelia
08/27/2022, 10:19 AM