Skip to content

Magento2 : Product Url Rewrite not woking Proppperly

I am facing an issue with the product URL rewrite. I have installed the extension “OlegKoval_RegenerateUrlRewrites” to generate URL rewrite.
some products are working but others are redirecting to 404.
here I have mentioned my configuration on admin:

I have set the product-category SEO url-key “checked” to Create a Permanent Redirect for the old URL.

product: https://i.imgur.com/WNe77HS.png
category: https://i.imgur.com/gJ8d3iT.png

I have set the below configuration in admin.

stores/configuration/general/web/Search Engine Optimization

https://i.imgur.com/TvaUgPL.png

Stores/configuration/catalog/catalog/Search Engine Optimization

https://i.imgur.com/tOpC4Mm.png

I have run below commands to re-generate URL:

php bin/magento ok:urlrewrites:regenerate –no-reindex –no-cache-clean –no-cache-flush

php bin/magento ok:urlrewrites:regenerate –entity-type=category –no-reindex –no-cache-clean –no-cache-flush

current URL: {{baseurl}}/catalog/product/view/id/1406/s/{{product_url-key}}/category/17/

expected URL : {{baseurl}}/{{category_url-key}}/{{product_url-key}}