I have tried to changed the default URL of contact page in magento2 to my custom URL but it is not working at all.

I have tried as follows:

Put the following code in my custom module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Custom_Module" setup_version="1.0.0">
        <module name="Magento_Contact"/>

And then rewrite the route as follows in routes.xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
   <router id="standard">
       <route id="contact" frontName="kontakt">
           <module name="Magento_Contact" />

Any Hint what is wrong going on here?


You can create url rewrite in Marketing > Url rewrites Click the Add URL rewrite button. Select the "Custom" URL rewrite type

Request Path kontact

Target Path contact/index/index

Redirect Type No


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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