Question

How can I change Magento 2 contacts page URL from /contacts to contact-us.html?

Was it helpful?

Solution

The easiest way is to create a CMS page and implement the following block.

{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}

But this would mean /contacts still works, but you could redirect this to the contact-us page.

If you really want to rewrite the url you could follow this method: Magento 2 - rewrite checkout and account url Wich is actually for checkout URL's but, it'd work the same way for the contacts url.

OTHER TIPS

You can manage via Url Rewrite. Goto admin>Marketing>Seo & Search> Url rewrite and You need to 2 rewrites .

contact-us.html to contact/index/index and redirect type NO.Please, select setting like:

enter image description here

Second: contact to contact-us.html and redirect type permanent

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top