0

I am an SEO executive and pretty new to Magento. I have got a project in which there are multiple URLs for a single product and all URLs have been indexed on Google. Here is an example of URL structure -

https://www.example.com/product-130565

https://www.example.com/main-category/product-130565

https://www.example.com/main-category/sub-category/product-130565

https://www.example.com/main-category/sub-category/sub-category/product-130565

Also, the canonical URL for every URL is different. I want to understand why Magento is creating so many URLs for a single product. Also, I only want to keep the third URL structure as the main URL and all other URLs should either redirect to that URL or is there a way that the other URLs can be removed.

Any help will be appreciated.

0

There is a configuration under Stores > Settings > Configuration > Catalog > Search Engine Optimizations > Use Categories Path for Product URLs > Yes/No

To regenerate product, category URLs you can use below module

https://github.com/olegkoval/magento2-regenerate_url_rewrites

To force redirect to the URLs without category path in them you can use the solution given in the below link

https://aureatelabs.com/magento-2/how-to-prevent-omit-category-path-from-product-url-to-access-the-product-page/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.