I want to create a module for which I would like 2 frontName is it possible. if yes how can I do it ?


1. example.com/a/index/test 
2. example.com/b/index/test 
both pointing to app/code/Vendor/Test/Controller/Index/Test.php

1 Answer 1


Define two routes in routes.xml

    <route frontName="name1" id="name1">
            <module name="Vendor_Module"/>
<route frontName="name2" id="name2">
            <module name="Vendor_Module"/>

Create different layout file for router

For NAME1:view/frontend/layout/name1_index_index.xml
For NAME2:view/frontend/layout/name2_index_index.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.