We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37377
    • 64 Posts
    Hi all,

    I'm making a custom product database for an online shop. Is there a way to implement friendly urls to the front end. I would like to have a seperate page per category (which I can do manually) where I show all related products (for which I have a snippet) but what I'm struggling with is the friendly url part.
    Building the links 'url.com/category/product' isn't a problem but I'd like that url to go somewhere. I could write a mod_rewrite rule for every category where I pass along the product as a variable but that doesn't seem to be the most logical/work-friendly approach.

    Any thoughts on this??
      • 33976 ☆ A M B ☆
      • 571 Posts
      Hi,

      Using rewrite rules can be an option. It's the chosen method for Discuss forums (see the doc since the repository isn't public anymore).

      Another option could be to use a plugin triggered on the OnPageNotFound event, with all your "route" logic. Yoleg did an interesting work on that mater, you might want to check some of his repository at Github, especially CustomUrls.

      Hope that will help ;-)
        • 37377
        • 64 Posts
        Thanks for the reply, I'll check it out!