PRODUCT URLs

Sometimes even though you have placed a product url in Magento Admin, it doesn't show on the frontend.  Instead you see a URL like this

https://example.com/catalog/product/view/id/5026

https://example.com/catalog/product/view/id/5025/category/185

To fix product url - perform the following steps

On the database you view specific entries for that url using the following sql statements:

SELECT * FROM `url_rewrite` WHERE `target_path` LIKE '%4729%'

SELECT * FROM `catalog_product_entity_varchar` WHERE `value` LIKE '%57642-beu%'

In Magento 2 Admin do the following

Open the product in admin and add 1 to url ( uncheck Create Permanent Redirect for old URL )

Save 

Open the product in admin again and remove the 1 you added to the url in previous step ( uncheck Create Permanent Redirect for old URL )

Save again

Run the first query above and you will notice 4 more records for a specific store_id you’re using.