Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 2 of 2
Created my own way to fix SEO URL issue…. 
 
Ronny Lange
Jr. Member
 
Total Posts:  18
Joined:  2008-02-03
Munich
 

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.

 Signature 

http://www.livac.de

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ronny Lange
Jr. Member
 
Total Posts:  18
Joined:  2008-02-03
Munich
 

Hi guys,

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 ($product->getCategoryId() && !$product->getDoNotUseCategoryId() && Mage::getStoreConfig('catalog/seo/product_use_categories')) {
$idPath .= '/'.$product->getCategoryId();
 }*/

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.

 Signature 

http://www.livac.de

 
Magento Community Magento Community
Magento Community
Magento Community
 
adam777
Jr. Member
 
Total Posts:  30
Joined:  2008-05-08
 
Dustin - 21 May 2008 05:10 AM

Conyx Group - 15 May 2008 10:47 AM
You only need to edit “list.phtml" inside “catalog” > “product” folder

edit the bold href(link) part, which is the image link (note: theis is not the modified line):

<a href=”<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>">

edit the bold href(link) part, which is the product link (note: theis is not the modified line):

<a href=”<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a>

If you guys cant solve it PM me, im pointing you in the right direction so you should be able to solve it.

Here is what I did to get this to work.

The place he has bolded I replaced with this:

<?php echo $this->getBaseUrl() . $_product->getUrlKey() . '.html' ?>

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.

Should I change all instances of

<?php echo $_item->getProductUrl() ?>

into this

<?php echo $this->getBaseUrl() . $_product->getUrlKey() . '.html' ?>

Which is the only similar content I’m finding in other files such as sitmap.phtml (as the sitemap gives duplicate content when I click on the links)

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  138
Joined:  2008-03-18
 

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?

Thanks - roco

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 2
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53209 users|764 users currently online|107248 forum posts