I'm trying to extend Magento 2 default module Magente_Contact, but I can't change the frontName, I tried to put in the di.xml, but nothing happens.
<config>
<router id="standart">
<route id="contact" frontName="contato">
<module name="[VENDOR]_Contact" />
</route>
</router>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Contact\etc\frontend\routes" type="{Vendor}\{Module}\etc\front\routes" />
</config>
Best Answer
There is a tricky way,you can change the contact us
Magento_Contact
module's frontend NameFirst, etc/module.xml of your module's make
Magento_Contact
as a depended module.And then changes frontend name from
routes.xm
l atetc/frontend/
.di.xml is not required