0

Currently my website works well and my products are having the following URLs

https://baseurl/catalog/product/view/id/19008

However, I bulk changed with the help of a module to a more set friendly URL such as:

https://baseurl/name_of_my_product

The issue is that I changed 17000 products but the redirect did not occur. I need to save the product one by one for my url to work which is crazy. I indexed the page after changing the url but it doesn't work.

0

2 Answers 2

0

Please install this module and run below command to regereate URL

https://github.com/elgentos/magento2-regenerate-catalog-urls

Usage:
 regenerate:product:url [-s|--store="..."] [pids1] ... [pidsN]
 regenerate:category:url [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:category:path [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:cms-page:url [-s]--store="..."] [pids1] ... [pidsN]

Arguments:
 pids                  Products (or Pages) to regenerate
 cids                  Categories to regenerate

Options:
 --store (-s)          Use a specific store (store Id, store code or 'all')
 --root (-r)           Regenerate for root category and its children, ignoring cids. 
 --help (-h)           Display this help message

# Regenerate url for all products and the global store
php bin/magento regenerate:product:url

# Regenerate url for products with id (1, 2, 3, 4) for store 1
php bin/magento regenerate:product:url -s1 1 2 3 4

# Regenerate url for all CMS pages
php bin/magento regenerate:cms-page:url -s all

# Regenerate url for root category 4 and its children for store 1
php bin/magento regenerate:category:url -s1 -r4

Once you run above command. You must need to run reindex command in magento root.

php bin/magento indexer:reindex
php bin/magento cache:clean
2
  • OK. will try it and let you know how it went. many thanks
    – Henri
    Jun 5, 2023 at 13:58
  • It worked great. Thank you.
    – Henri
    Jun 5, 2023 at 15:18
0

Please try once this module

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

Command : php bin/magento ok:urlrewrites:regenerate --entity-type=product

1
  • That's great! thanks
    – Henri
    Jun 5, 2023 at 15:18

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.