On my site, during the development process, products were created and imported using a variety of processes. Now I find that the URL rewrites are not uniform and don't seem to work in all cases.
Some products rewrite/redirect correctly, and some do not rewrite/redirect at all. In these cases, even though there are url_keys stored in the products, the rewrite part doesn't seem to be happening.
Since the site is still in developmnet, I don't need to preserve any old rewrites or any custom ones. I'd really like to clear them all out and regenerate them all based on the current product names.
In CE, I would truncate the core_url_rewrite table and reindex, and that would take care of things. I am not sure if this is possible in the Enterprise edition. Is there a similar process/procedure that I can use to recreate the rewrites and make the products use the rewrites? I have seen similar problems involving 1.13 and write-ups about fixing similar behaviors, but I'm not comfortable working with instructions that are 2-3 years old and for versions of Magento that are 2-3 back.
I ran this MySQL query to remove all URL Rewrites:
SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE `enterprise_url_rewrite_redirect_rewrite`; TRUNCATE TABLE `enterprise_url_rewrite_redirect_cl`; TRUNCATE TABLE `enterprise_url_rewrite_redirect`; TRUNCATE TABLE `enterprise_url_rewrite_product_cl`; TRUNCATE TABLE `enterprise_url_rewrite_category_cl`; TRUNCATE TABLE `enterprise_url_rewrite`; TRUNCATE TABLE `enterprise_catalog_product_rewrite`; TRUNCATE TABLE `enterprise_catalog_category_rewrite`; TRUNCATE TABLE `core_url_rewrite`; SET FOREIGN_KEY_CHECKS = 1;
Then reindex all from command line...
That helped a lot, but I still see some products that have a url_key assigned, but don't seem to have an associated rewrite in the database.
In the frontend, I see:
where the value "my-really-cool-product" is the value of the product "url_key".