I realise similar questions have been posed before, but I have an additional caveat when I ask the following question.
How can Magento URLs be rewritten such that:
http://www.example.com/category/subcategory.html
Becomes:
http://www.example.com/subcategory.html
…without accessing the Admin menu or installing additional modules, and purely by editing the .htaccess file? Is there a way?
(If the .html can be stripped off the end as well, that would be terrific!)
Thank you for your time. 🙂
Best Answer
To remove category paths from product url set
"Use Categories Path for Product URLs"
to"No"
underSystem -> Configuration -> Catalog -> Search Engine Optimizations
.To remove parent category path from child category url
Rewrite class
Mage_Catalog_Model_Url
override method
public function getCategoryRequestPath($category, $parentPath)
like belowModified below code
to