Custom URL Rewrites for Categories and Products

categoryproducturl-rewrite

we have category and product URLs already indexed by google so we need to add/modify Magento URL Rewrites to match those URLs. We are migrating one of the ecommerce store from yahoo to magento, but we can't change the url structure as they are already indexed by google.

So basically, what I want is..

Magento URL: http://www.website.com/cat1/cat2.html
Need URL: http://www.website.com/cat2.html

Magento URL: http://www.website.com/cat1/product.html
Need URL: http://www.website.com/product.html

Magento URL: http://www.website.com/cat1/cat2/product.html
Need URL: http://www.website.com/product.html

At one extent I managed to solve this with product pages, by enabling Canonical URLs for categories and products from backend. But that doesn't help for all the cases, like for multiple categories in the URL.

Any help will be much appreciated!

UPDATE: I have disabled "Use Categories Path for Product URLs" and URLs with products are working as it should be. But the category link is still not solved. If there are multiple categories in the url, then issue still comes.

So, the original Magento URL www.website.com/cat1/cat2.html should be www.website.com/cat2.html only without cat1 in url.

Best Answer

You can solve this via admin setting in system->configuration->catalog->search engine optimization.

'Use Categories Path for Product URLs' set to no, and re-index url_rewrites.

This will remove the category from urls.

Related Topic