2

I can't see URL rewrite index in Magento 2. Can anybody let me know from where URL rewrites can be indexed manually?

Updates

After looking at the code of module "module-catalog-URL-rewrite" and KAndy's comment, it seems that "Magento 2 URL rewrite module does not use Indexer to create rewrites. The rewrite is generated in the process of save/import of product/categories/cms pages".

But I have turned ON setting 'Use Categories Path for Product URLs' and product URL were not generated using category paths. Now URL on front end of my store is like http://local.magento2.com/index.php/catalog/product/view/id/1545/category/21/

So I am just curious to know how can I generate product Url's using category paths.

enter image description here

3 Answers 3

4

In Magento 2 url rewrite module does not use Indexer to create rewrites. Rewrite is generated in process of save/import of product/categories/cms pages.

1
  • Yeah, it seems to be correct by looking at the code of module "module-catalog-url-rewrite". But I have turned ON setting 'Use Categories Path for Product URLs' and product URL were not generated using category paths.. Now URL on front end of my store are like local.magento2.com/index.php/catalog/product/view/id/1545/…
    – Ravinder
    Commented Dec 29, 2015 at 11:06
2

After truncating the url tables, you need to re-save all products and categories again. This will regenerate the url re-writes. Products can be done on mass, but each category needs to be saved by hand.

3
  • How to mass product save? Commented Mar 2, 2018 at 12:35
  • @MohammedJoraid something like mage2-blog.com/magento-2-speed-up-product-save ?
    – Barry
    Commented Oct 23, 2019 at 14:17
  • @Barry thanks for the link. This was last year and I used CLI extension that regenerated all urls. One guy suggested using Product grid bulk action and change the store and back forth and all of the products will be saved. I remember using all but can't remember which one worked. Commented Oct 23, 2019 at 23:56
1

This was fixed in app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml:

https://github.com/magento/magento2/commit/e0f560f7d973e03a88f0f71ea932dc3add3599fa

The other issue is the URL not having the category path unless the user actually clicks through each category to get to the product. It is in the "in progress" stage at this link: https://github.com/magento/magento2/issues/2619

1
  • i have same problem but above solution not working after migration Commented Apr 27, 2016 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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