Magento Custom Route – How to Create Custom Route in Custom Module Magento 2

custommagento-2.1magento2module

How to create a custom route in Magento 2

http://127.0.0.1/magento8/trails/post/view/id/13

module:- trails

folder :-post

controller :- view

argument :-id/13

I want to http://127.0.0.1/magento8/slug/

enter image description here

anyone help me

Best Answer

Just create an entry in Admin Panel > Marketing > SEO & Search > URL Rewrites

with request path as slug and target path as trails/post/view/id/13

This should help.

Related Topic