Is there a way to modify or prepend the product url? We are working on a large website (500 Iproducts), and I think it becomes quite cluttered to have them all “in” the root directory. I would like to organize things a bit better, in this case, putting products/ in the url before the product key.
What would you recommend as the cleanest and best way to prepend “products/” into the url key? I wanted to see if there were any suggestions here before I rolled my sleeves up and got working on some overrides. I have tried setting the URL key to be that, but, naturally, it strips the / for a -. I figured that would happen.
That’s going to be tricky to pull off. The URLs for products, as well as products-by-categories are generated somewhere deep in the indexing system. When you save a product or category being the scenes, the re-indexing that kicks off includes tasks that generate a number of
core/url_rewritemodels, stored in thecore_url_rewritetable. These models are what make the “SEO Friendly” urls. So you’d need to find that code, and add your custom logic there to generate the correct rewrite modelsThen you’d need to check the URL helpers to ensure they were generating the correct URLs. I’m not sure if these methods consult the rewrite table (which would be good), or if they act with foreknowledge abou how Magento’s URLs would be structured).
Good luck.