Magento Forum

   
Better urls in my shop
 
karsteng
Member
 
Total Posts:  34
Joined:  2011-10-13
 

I have a problem with my urls in my shop. On my frontpage the products link to
.com/productname

But if I go through my menu, the products are in
.com/category/productname

How can I change this so all are shown with /category.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
sumantechno
Guru
 
Avatar
Total Posts:  478
Joined:  2010-03-09
Bangalore
 

What menu you are using.By default magneto do not provide product link in the menu.
If you use CMS widget the also you will get the direct product link.So you are using any extension of Custom theme.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karsteng
Member
 
Total Posts:  34
Joined:  2011-10-13
 

Well it’s actually the frontpage items I would like to change so they include the category in the url. I use this to display my frontpage products:

<p>{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list-limit.phtml"}}</p>

 
Magento Community Magento Community
Magento Community
Magento Community
 
sumantechno
Guru
 
Avatar
Total Posts:  478
Joined:  2010-03-09
Bangalore
 

That is not a problem it is a feature.
My be your product can be associated with more than one category.Then what will be the desired link.So you can not include the category URL in general page like in Home Page.
But in category page the product displayed are from the category so we can specify the category in the URL.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karsteng
Member
 
Total Posts:  34
Joined:  2011-10-13
 

Thanks for your answer. But if that’s the case, there will be huge problems with dublicate content, right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sumantechno
Guru
 
Avatar
Total Posts:  478
Joined:  2010-03-09
Bangalore
 

Content is not duplicated. Magneto automatically fiends the URL of the current category dynamically and assign it to the list page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karsteng
Member
 
Total Posts:  34
Joined:  2011-10-13
 

Sorry what I ment was that, Google will see this as dublicate content, right? Seen from a search engine’s point of view, there are two products in different categories. One in /category/product and one in /product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sumantechno
Guru
 
Avatar
Total Posts:  478
Joined:  2010-03-09
Bangalore
 

No..that will be not a issue.One product can be assigned to multiple products.
Like a mobile phone can be assigned to the “Nokia” category and can be assigned to “Electronics” category.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MattStephens
Sr. Member
 
Avatar
Total Posts:  152
Joined:  2011-07-12
United Kingdom
 

Hello. Hopefully I can provide some input into this, having come across a similar need for a workaround to this feature/problem and a possible solution (hack)…

In short I wanted store.com/product to always be store.com/category/product no matter where the product is output (sitemap, category, custom modules etc)

However the reason Magento doesn’t adopt this approach is a product can be in multiple categories. It only appends the category path when it is viewing the direct category a product is assigned to.

I wrote a brief article about the reasons behind it, and a work around if people must only have one URL per product.

However the caveat is that if a product is assigned to two categories /store.com/category and store.com/category2 lets say, it’ll use only the first URL category path, even if you are in the category2 page.

To use my approach you’ll need to modify the sererval places Magento outputs product URLs (sitemap etc) and add the AddUrlRewrite function.

You can read more on canonical URLs in Magento here...

Cheers
Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
sumantechno
Guru
 
Avatar
Total Posts:  478
Joined:  2010-03-09
Bangalore
 

Yes you are write...Yes that I am specified earlier.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karsteng
Member
 
Total Posts:  34
Joined:  2011-10-13
 

Thanks a lot for your replies. I understand the problem with multiple categories. However in this shop I am working on right now, the products will only be in a single category each. Thanks a lot for the link to the \\\\\\\\\\\\\\\"hack article\\\\\\\\\\\\\\\” smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top