質問

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