--- Collection.php (revision 2102) +++ Collection.php (working copy) @@ -553,7 +553,11 @@ ->from($this->getTable('core/url_rewrite'), array('product_id', 'request_path')) ->where('store_id=?', Mage::app()->getStore()->getId()) ->where('is_system=?', 1) - ->where('category_id=? OR category_id is NULL', $this->_urlRewriteCategory) +// excluding this clause to facilitate one URL per product, and one that includes the category +// if a product has multiple categories, the first one (by category_id) will be used +// in most cases you'll probably only have one category because you only want one page per product for SEO reasons +// for maximum link juice, no possibility of duplicate content, and a less confusing store +// ->where('category_id=? OR category_id is NULL', $this->_urlRewriteCategory) ->where('product_id IN(?)', $productIds) ->order('category_id DESC'); // more priority is data with category id $urlRewrites = array();