The catalog URL rewrite indexers do not work correctly for some reasons. I realised something was wrong when, with FPC on (or Varnish), a wrong category (or no category at all) were set on the product view page. I tried to debug it a bit, and found out that the URL reindexer did not add any entries for target paths like
catalog/product/view/id/XXX/category/YYY, even though the option "Use category path in product URL" is active. I simply found product URLs with no category attached like
catalog/product/view/id/XXX. I though a full reindex would help in this, therefore I truncated all URL rewrite tables on my dev machine and run the indexer via CLI. Same result: no entry for products in the categories.
Puzzled, I did the same on a fresh install on Magento EE with test data: run installation, truncated all url_rewrite tables, and run a full reindex. Magento creates entries for category URLs, products URLs, but I found nothing for products with category paths. Is this a bug or a "feature"? Am I missing something here? Did anyone have the same problem?
I tried to investigate this issue a bit further. The Catalog URL and Product URL indexers are definitely not creating these rewrites, other than what happened in EE 1.12 / CE 1.7. The only place I could find where these rewrites are created is in
enterprise_catalog/observer: the event observer is bound to
catalog_product_save_after and generates the rewrites for product URLs including the category path. However, and this is something I don't get, these are not system paths as in the past (
is_system is set to 0), but they are created as redirects.