配送をURL キーとして保存できません

この記事では、商品またはCMS ページの配送をURL キー(例:/shipping)として保存できない場合の問題に対する回避策を説明します。 URL キーを保存しようとすると、URL キーが重複するURLであることを示すエラーが表示されます。

説明 description

環境

Adobe Commerce(すべてのデプロイメント・メソッド), 2.4.x

問題

You cannot save a CMS page with the term shipping in the URL key.

再現手順:

URL キーが​ shipping ​のCMS ページ を作成します。

期待される結果:

ページが保存され、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)。

用語は​shipping+<別の数字または文字>である必要はありませんが、長さが​ 255 ​文字を超えない限り、用語は任意の文字列にすることができます。

次の手順を実行します。

  1. Adobe Commerce Adminにログインします。

  2. マーケティング に移動 > SEOと検索 > URLの書き換え

  3. URL書き換えを追加」をクリックします。

  4. URLを作成」ドロップダウンで「 カスタム 」を選択します。

    1. リクエストパスに「shipping」と入力します。

    2. ターゲットパス に、新しいURL キーを入力します(例:shipping1)。

    3. リダイレクト 」ドロップダウンで「No」を選択します。

      注意: リクエストパスは、ユーザーがブラウザーに入力するパスであり、ターゲットパスは、リダイレクト先です。)

また、同じ例外が表示される​reserved キーワードとしてラベル付けされたこれらのキーワードを使用しないでください。 以下に示すキーワードのいずれかを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"

関連トピックス

recommendation-more-help
experience-cloud-kcs-help-kbarticles