Hi everyone,
I’m using PrestaShop 1.7 and I need to clean up my CMS page URLs so they no longer include the numeric ID prefix. Right now, even after changing the “Route to CMS pages” in Shop Parameters → Traffic & SEO from
bash
KopiujEdytuj
content/{id}-{rewrite}
to
bash
KopiujEdytuj
{id}-{rewrite}
I still end up with URLs like:
arduino
KopiujEdytuj
I’ve also set the Friendly URL slug (Link rewrite) to stores, and regenerated .htaccess + cleared cache, but the ID (here: “6”) stubbornly remains.
Unfortunately, PrestaShop’s back‑office forces the {id} placeholder in the routing pattern whenever you edit through the UI.
Thanks in advance for any guidance or code samples!
I’m using PrestaShop 1.7 and I need to clean up my CMS page URLs so they no longer include the numeric ID prefix. Right now, even after changing the “Route to CMS pages” in Shop Parameters → Traffic & SEO from
bash
KopiujEdytuj
content/{id}-{rewrite}
to
bash
KopiujEdytuj
{id}-{rewrite}
I still end up with URLs like:
arduino
KopiujEdytuj
I’ve also set the Friendly URL slug (Link rewrite) to stores, and regenerated .htaccess + cleared cache, but the ID (here: “6”) stubbornly remains.
What I’ve tried so far
- Disabled multistore (I no longer need it).
- Edited Shop Parameters → Traffic & SEO routing to {rewrite} and {id}-{rewrite}.
- Cleared cache & rebuilt .htaccess by toggling Friendly URLs off/on.
- Checked that my CMS page’s Meta title, Meta keywords and Link rewrite are set correctly to stores.
Unfortunately, PrestaShop’s back‑office forces the {id} placeholder in the routing pattern whenever you edit through the UI.
What I’m looking for
- A code‑based solution (module or override) that hooks into PrestaShop’s routing and defines a new cms_page rule without the id parameter.
- Ideally something that works via hookModuleRoutes (PS 1.7) or a minimal override of the Link/Symfony routing.
- Example snippets or a small “dummy” module would be greatly appreciated.
Thanks in advance for any guidance or code samples!