How to create friendly URL for different taxonomies?
-
Hello, everyone!
I have a hierarchy of categories:
Catalog
-Cars
— Alfa Romeo
— Audi
— BMW
-Trucks
— Alfa Romeo
— Audi
— BMW
The brands of cars can be in different types of vehicles.
Here is the problem. I have the pages:
site.ru/catalog/ — a catalog page.
site.ru/catalog/cars — a page with car brands.
site.ru/catalog/trucks/bmw — a product page of a particular brand and type of car.
site.ru/catalog/cars/bmw/product — a product page.
I want to avoid duplicating terms, create 2 different taxonomies, and add new rewrite rules for the catalog page.
But then what to do with broken links like site.ru/catalog/cars/blablabla or site.ru/catalog/blablabla/bmw, which should redirect to the 404-page?
Maybe it’s better to parse query variables, check information about the URL exists in my database, and if it does not do a redirect to 404-page?
Maybe do you know a more elegant solution?
- The topic ‘How to create friendly URL for different taxonomies?’ is closed to new replies.