无法将送货另存为URL键
当您无法为产品或CMS页面将配送另存为URL密钥(例如: /配送)时,本文提供了此问题的解决方法。 当您尝试保存URL键时,您会收到一个错误,指示URL键是重复的URL。
描述 description
环境
Adobe Commerce(所有部署方法),2.4.x
问题
You cannot save a CMS page with the term shipping in the URL key.
重现问题的步骤:
创建一个 CMS页面,URL键为 shipping。
预期结果:
该页面将以 shipping 作为URL键进行保存。
实际结果:
发生此错误时,无法保存:
在URL键字段中指定的值将生成一个已存在的URL。
原因
送货是在vendor/magento/module-shipping/etc/frontend/routes.xml中定义的保留字。
<router id="standard">
<route id="shipping" frontName="shipping">
<module name="Magento_Shipping" />
</route>
</router>
解决方法 resolution
无法在URL密钥中使用术语 shipping,但可以将术语 shipping 与另一个字母或数字结合使用(例如,shipping1 和 shipping2)。
尽管术语不必是 发货+<其他数字或字母> — 术语可以是任何字符串,只要长度不超过 255 个字符。
执行以下步骤:
-
登录到Adobe Commerce管理员。
-
转到 营销
>SEO和搜索>URL重写。 -
单击 添加URL重写。
-
在 创建URL重写 下拉列表中选择 自定义。
-
键入请求路径为 shipping。
-
在 目标路径 中,键入新的URL密钥(例如,shipping1)。
-
在 重定向 下拉列表中选择 否。
(注意:请求路径是用户在浏览器中输入的内容,目标路径是用户应重定向到的路径。)
-
此外,请避免使用这些标记为 保留 关键字的关键字,这会导致出现相同的异常。 使用下面列出的这些关键字中的任意关键字作为URL键值将导致出现相同的错误。
"admin"
"adminAnalytics"
"analytics"
"api"
"backup"
"bulk"
"captcha"
"catalog"
"catalogsearch"
"checkout"
"cms"
"contact"
"cookie"
"customer"
"directory"
"downloadable"
"giftmessage"
"groupedProduct"
"indexer"
"instantpurchase"
"loginascustomer"
"marketplace"
"mui"
"multishipping"
"newsletter"
"oauth"
"paypal"
"persistent"
"productalert"
"releaseNotification"
"reports"
"review"
"robots"
"rss"
"sales"
"search"
"security"
"sendfriend"
"shipping"
"stores"
"swagger"
"swatches"
"tax"
"theme"
"translation"
"vault"
"wishlist"
3d58f420-19b5-47a0-a122-5c9dab55ec7f