You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento前端全部分类链接跳404:排查数据表及后台设置咨询

Magento分类页面全跳404:数据库表与后台设置排查指南

Hey there, let's walk through this issue you're facing—all category pages redirecting to 404 even after running the catalog URL reindex. Here's what you need to know:

关联的数据库表

First up, the key database tables tied to category URLs:

  • catalog_category_entity_url_key: This table stores the unique URL key for each category, mapped to specific store views. If entries here are missing, duplicated, or linked to the wrong store ID, it can break URL generation entirely.
  • core_url_rewrite: The bread and butter of Magento's URL routing. This table holds all rewrite rules, including those for categories. When you run the catalog URL reindex, Magento populates or updates entries here to map friendly category URLs to their internal paths. Corrupted, missing, or conflicting entries here are a top culprit for 404 errors.

后台设置需要检查的点

Don't overlook these backend configurations—they're often the root cause even after reindexing:

  • Category Status & Visibility: Head to Catalog > Categories, select each category, and confirm:
    • The category is set to Enabled under the General Information tab.
    • Under the Store View tab (for each active store), the Visibility is set to either Catalog, Search or Catalog (not Not Visible Individually).
  • URL Key Uniqueness: Still in the category edit page, check the Search Engine Optimization tab. Ensure the URL Key is unique for the store view—duplicate keys will prevent proper rewrite rules from being generated during reindex. Stick to lowercase letters, numbers, and hyphens here (avoid special characters).
  • SEO Configuration: Go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization. While Use Categories Path for Product URLs primarily affects product URLs, misconfigurations here can sometimes disrupt related category URL logic. Double-check it's set to your intended value.
  • Store Code in URLs: Check Stores > Configuration > Web > Search Engine Optimization and the Add Store Code to Urls setting. If this is enabled, make sure your category URLs include the correct store code (e.g., yourstore.com/en/category instead of yourstore.com/category). Mismatches here will trigger 404s immediately.

Quick Extra Checks

  • Flush all Magento caches with the command bin/magento cache:flush—sometimes old cached URL rules stick around even after reindexing.
  • Verify your server supports URL rewriting: For Apache, ensure mod_rewrite is enabled; for Nginx, confirm your configuration includes proper rewrite rules for Magento.

内容的提问来源于stack exchange,提问作者Marius Boia

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:59:51