0

I tried to 301 redirect contact form page URL to custom cms page URL with Magento 2's rewrites, but it does not seem to redirect the URL for some reason.

Is there some special trick to be done with contact form redirection?

1

Create a custom url rewrite in your admin.

Target path: custom-cms-url (without any slahes /)

Request path: contact

Make sure you have a cron job setup for reindexing and that the url rewrite was made for the correct store view.

  • Well I think this worked after all. I tried this in live and it does not work, but in testing installation it does work so I guess it has to be a caching issue or something. – Webninja Jan 3 '18 at 16:49
0

You can use.htacess write following code

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]

or you can do with admin panel also

1st -> go to admin -> marketing -> seo&search -> urlrewrite change url according to your requirements

0

I would suggest overwriting contact form. To do that create a contact_index_index.xml file in Your_Theme_Folder > Magento_Contact > layout

You can here add CMS block for example.

You can also overwrite template by creating a form.phtml file in Your_Theme_Folder > Magento_Contact > templates to edit the default form template.

With those two methods, you can fully overwrite the default contact page.

If you really want to use a CMS Page I think the best way is to disable contact us feature in Configuration > Contacts > Contacts us and disable contact us. Then create your CMS Page with the default contact url.

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.