How to rewrite Magento 2 default contact page url
-
16-01-2021 - |
Question
How can I change Magento 2 contacts page URL from /contacts to contact-us.html?
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange