2

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

Example

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

1 Answer 1

5

Define two routes in routes.xml

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

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 that you have read and understand our privacy policy and code of conduct.

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