Unable to redirect a category in Magento using URL Rewrites

Unable to redirect a category in Magento using URL Rewrites

July 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Unable to redirect a category in Magento using URL Rewrites

Solving Magento Category Redirect Issues

Hello! I understand your frustration when dealing with Magento’s URL rewrite system for categories. Let’s troubleshoot this step-by-step.

Understanding the Problem Context

You’ve deactivated a category (ID:46) and are trying to redirect it using Magento’s built-in URL rewrites feature. However, despite following various guides and trying different configurations, you’re unable to get a successful redirect from your shop path.

The key issue seems to be that redirection is not working when the target path includes a category ID or product ID within the shop context.

Why Some Redirects Work and Others Don’t

Magento treats URLs differently based on their context within the CMS. When you try to redirect from a non-shop path (“any-uri”), it works fine because these are treated as simple URL rewrites, regardless of what they point to.

However, when you’re working with shop paths that include category or product IDs (like “shops/friendly-uri” and “category/46”), Magento applies additional logic related to its CMS structure. This is where the complexity arises.

A Closer Look at Your Configuration

From your description:

  1. ID Path: category/46 - This seems correct for a category redirect.
  2. Request Path: shops/friendly-uri - The issue here might be that this path contains a non-standard format (“friendly-uri”). Magento expects standard URLs or paths (like “category-46”).
  3. Target Path: catalog/product/view/id/3111/category/52 - This is redirecting to a specific product in category 52, which could be the issue if category 46 and 52 are not related.

Best Practices for Magento Category Redirects

1. Use Standard URLs in ID Path

In your ID Path, use standard URLs or paths that match your category’s URL key. For example, if your category has a URL key of “clothing”, the ID path should be category/clothing.

Example: category/clothing

2. Keep Target Path Simple and Direct

For the Target Path, try to keep it as simple and direct as possible.

  • If you want to redirect to another category, use its URL key directly (e.g., category/other-category).
  • If you want to redirect to a landing page or homepage, use something like catalog/category/view/id/2 where 2 is your home category ID.

Example: category/fashion-accessories

3. Deactivate the Old Category Correctly

Ensure that you have actually deactivated the old category correctly in Magento’s admin panel. Just setting it to “Inactive” might not be sufficient for URL rewrites to work properly.

Troubleshooting Steps to Try

  1. Check your .htaccess file: Ensure there are no conflicting rules or redirects defined elsewhere.
  2. Clear cache: After making changes, always clear Magento’s cache (System > Cache Management).
  3. Flush rewrite URLs: Go to System > Configuration > Catalog > XML Configuration and click “Flush Rewrite URLs” under the “URL Rewrite Options” section.

Conclusion

Magento’s URL rewrites for categories require a specific understanding of how they interact with the CMS structure within the shop context. By keeping your URLs standard, targets simple and direct, and ensuring proper deactivation of old categories, you should be able to achieve successful redirections.

Remember, Magento has its quirks when it comes to redirects, especially around category IDs. Always try to keep your URL structures as clean and predictable as possible within the context of your store’s CMS.

Don’t hesitate to explore more advanced solutions or seek professional help if the issue persists. My team at LaravelCompany specializes in Magento development, and we’re always ready to assist with complex technical problems like this one.

Keep experimenting and let me know if you need any further guidance!

Catalog Themes Configuration SEO

Our network