문제

Product urls are displaying with category and product id

Now url is displaying like below http://localhost/magento2/catalog/product/view/id/1234/category/12/

But i want http://localhost/magento2/test-product

도움이 되었습니까?

해결책

Try to edit 1st level or 2nd level categories and simply save it and it will generates rewrites for products assigned to that category. This worked for me when i migrated store from Magento 1 to Magento 2.

다른 팁

We can configure it by URL Rewrites

  1. Go to Magento 2 Admin -> Marketing -> SEO & Search -> URL Rewrites

  2. Find the path by searching Request path column.

  3. Remove the cache php bin/magento cache:clean.

  4. Refresh the front-end, click the main menu category then you can see the configured path.

Or

You Can Build category URL path by

\vendor\magento\module-catalog-url-rewrite\Model\CategoryUrlPathGenerator.php 

Modify getUrlPath($category) by Magento Plug-in feature.

Hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top