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, SearchorCatalog(notNot 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. WhileUse Categories Path for Product URLsprimarily 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 Optimizationand theAdd Store Code to Urlssetting. If this is enabled, make sure your category URLs include the correct store code (e.g.,yourstore.com/en/categoryinstead ofyourstore.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_rewriteis enabled; for Nginx, confirm your configuration includes proper rewrite rules for Magento.
内容的提问来源于stack exchange,提问作者Marius Boia
相关产品推荐
相关产品推荐

