1

We're currently using Magento CE v1.8 and are subject to the bug which causes product URL keys to be appended with an incremental number every time we run an index, which in turn is causing a large amount of URL rewrites to be generated each time as well. However, with the way our site operates we only use the category URL paths/keys i.e. the product URLs are not included in our sitemap and are not published for the public to use.

My question is; would there be a problem if we just removed all of the product URL keys?

1

from my point of view there are 2 alternative that you may follow to use only one url for one product. so it will be very good for SEO purpose.

1) Change "Use Categories Path for Product URLs" property in System -> Configuration -> Catalog to "No".

2) the method Mage_Catalog_Model_Product_Url::getUrl() checks this setting with $product->getDoNotUseCategoryId(). I called this method, and it returned NULL for all the products.

To solve this, I overloaded this method in my own product class:

public function getDoNotUseCategoryId(){
    return true;
}

This works.

i would suggest to use my first option.

hope this will sure help you.

  • Thank you for your answer, but I perhaps didn't make my question clear. We only want to use the category path URLs as we do not wish to have pages for each individual product. The lowest level pages visible on our site are still categories e.g. www.pipestock.com/pvc/pvc-pipe. Magento automatically generates a product URL for each product which sits in the root e.g. www.pipestock.com/pvc-pipe-5mm-x-50m, but we don't wish to use these, so can I just remove them all? – Jonny Paulton Oct 16 '14 at 9:18
  • yes you can remove it but still ur problem will not resolve. if user know product id they can access like localhost/magento/catalog/product/view/id/23 this is my local but instead of that your domain would be there. so you have overwrite catalog prodduct controllers viewAction. to redirect user to product's category – liyakat Oct 17 '14 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.