Page 1 of 1
Want help on removing category urls from product urls
Posted: Fri Apr 16, 2021 11:55 pm
by Jeff600
Hi,
We are currently having URL structure as domain.com/category/sub-category/product-name , We want this to be changed to domain.com/product-name by removing /category/sub-category from the product page urls.
Also another thing is when once we done this to avoid 404 errors, how can 301 redirect all old urls to new urls
Re: Want help on removing category urls from product urls
Posted: Sat Apr 17, 2021 1:16 am
by straightlight
OC version.
Re: Want help on removing category urls from product urls
Posted: Sat Apr 17, 2021 1:25 am
by johnp
Jeff600 wrote: ↑Fri Apr 16, 2021 11:55 pm
Also another thing is when once we done this to avoid 404 errors, how can 301 redirect all old urls to new urls
Something like this would help:
https://www.opencart.com/index.php?rout ... search=301
Re: Want help on removing category urls from product urls
Posted: Sat Apr 17, 2021 6:20 pm
by JNeuhoff
We are currently having URL structure as domain.com/category/sub-category/product-name , We want this to be changed to domain.com/product-name by removing /category/sub-category from the product page urls
From a SEO perspective it doesn't make any difference. Just make sure the link canonicals are correct on your product page, they should be without cateory path by default.
Re: Want help on removing category urls from product urls
Posted: Sun Apr 18, 2021 4:59 pm
by Jeff600
Re: Want help on removing category urls from product urls
Posted: Sun Apr 18, 2021 5:01 pm
by Jeff600
JNeuhoff wrote: ↑Sat Apr 17, 2021 6:20 pm
We are currently having URL structure as domain.com/category/sub-category/product-name , We want this to be changed to domain.com/product-name by removing /category/sub-category from the product page urls
From a SEO perspective it doesn't make any difference. Just make sure the link canonicals are correct on your product page, they should be without cateory path by default.
What do you mean by making suree link canonicals are correct i.e currently we are seeing /category/sub-category structure, how to remove that? can you please elaborate on how to do in opencart 2.2?
Re: Want help on removing category urls from product urls
Posted: Mon Apr 19, 2021 5:44 pm
by JNeuhoff
You don't get it, do you? The product page already has a link canonical in there without the category path, just for Google. For example, something like this:
Code: Select all
<link href="https://example.com/kingston-128mb" rel="canonical" />
while the URLs could include various category paths leading to the same product page, e.g.
/storage/flash-memory/kingston-128mb
/storage/kingston-128mb
/accessories/kingston-128mb
/kingston-128mb
etc.
A product can belong to different categories, including lower level categories. This makes perfect sense for user-friendly navigation and URLs. But for SEO purposes the link canonical is generated as described above. See this
Google docs for more information.
Re: Want help on removing category urls from product urls
Posted: Mon Apr 19, 2021 6:24 pm
by paulfeakins
Search for a canonical URL extension in the marketplace.