Вопрос

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

Это было полезно?

Решение

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top