Thanks for sharing your ideas and the way of solving this problem.
I also disabled category rewrites before. The problem i see is working with the right breadcrumb, cause if we disable category rewrites in url, we also disable the system of getting the right breadcrumb. If i put a product in more than one category i couldn’t say which one is the base category.
Do you make a change of url.php that works fine? Would be nice sharing your ideas.
now i use the following workaround. I changed the url.php (app/code/core/Mage/Catalog/Model/Product/Url.php) commented out line 81-83. This function normally extend the product path with the category id.
If you now create a product without choosing any category you will get an “main category” (Look at url_rewrite in admin - something like product/11). This one will never change, although you delete or put this product to other categories.
But there is also one small problem. Using this workaround you loose the functionality of the breadcrumb including category name and links. But i think this doesn’t matter, because in magento there is a function “getCategories() by a product object”. So you can show all categories, including this product instead of the breadcrumb.
I know there is a field in the db that stores the url key with the .html on the end, but I have not figured out how to make a call to get that yet, but this works great for me for now.
Is this posting relevant to me as I am getting all kinds of strange URL’s that are not what is specified in my “URL key “
For Example:
URL Key = “pnv301”
Actual URL = “/pnv301-2”
The problem with this is that google spiders my site and finds “pnv301-2” and lists it as a duplicate page. My sitemap xml file is correct with just the “pnv310” URL Key.
If there is a fix for this could someone point me to it?