我认为 Magento 2.1 改变了修改联系页面 url 的方式。旧教程不再适用,如下所示:(更改 Magento 联系人页面 URL)。
也许我也做错了什么。
谁能帮我?
我将不胜感激任何回应。
您需要覆盖文件夹中存在的 routes.xmlvendor\magento\module-contact\etc\frontend\
文件
从改变
<code>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="contact" frontName="contact">
<module name="Magento_Contact" />
</route>
</router>
</config>
</code>
至:
<code>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="YOUR_Choice" frontName="YOUR_Choice">
<module name="Magento_Contact" />
</route>
</router>
</config>
</code>
您可以使用.htacess 编写以下代码
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-> 去 admin->marketing->seo&search->urlrewrite 根据您的要求更改 url
Here you have to Add 2 URL Rewrite
For example for login
1)
Request Path : customer/account/login
Target Path : login
Redirect Type : Permanent (301)
2 (another rewrite for same )
Request Path : login
Target Path : customer/account/login
Redirect Type : NO
Hope fully it will works.
In both url call perform same operations