magento-1.9catalog

Magento 1 - Removing product id from product url


Is it possible to remove product id from URL rewrite replacing it with another attribute, for example SKU?

From my brief research it seems that ID is added explicitly (line 749 of Mage_Catalog_Model_Url)

Has anyone tried to do this? Any drawbacks of doing so?


Solution

  • The product ID usually gets added to the URL string when two products share the same URL Key. An easy way to check which products are conflicting is to take the ID off the end of a page and see which product loads. Once each product has a unique URL Key the product IDs will not get added to the end.

    I would also export the product list with the URL Key and confirm that the product ID isn't defined in the URL Key. That would also be the easiest way to add the SKU to the URL Key if you really want it there. i.e. export the product list with URL Key, change the URL Key to use the SKU, import the modified list.