Magento 2 stores with different product url

Magento 2 stores with different product url

October 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 stores with different product url

Managing Magento 2 Stores with Different Product URLs

The Challenge: Duplicated URLs for Different Brands

In your scenario, you’re running into a common issue in e-commerce - managing products that exist under different brands on separate websites, each with its own URL. This can lead to duplicate content and broken URLs when the product name or brand varies between sites.

Let me break down your situation:

  • You have two Magento 2 stores (Site1 and Site2).
  • Some products are available in both stores but under different brand names.
  • The default URL key for the product is the same across both stores, causing a conflict.

Understanding the Root Cause

The root of this problem lies in how Magento handles URLs by default. When you save a product with a specific name and generate the URL key automatically (which is the default behavior), Magento will use that same key across all store views unless explicitly configured otherwise.

This is fine when your products have unique names within each brand. But when you reuse the same base name for different brands, it creates duplicate URLs - one for each view.

The Inefficient Way: Manually Creating URL Rewrites

Your instinct to create custom URL rewrites is correct in principle. It allows you to map the correct product to a specific URL per view. However, this approach has several major drawbacks:

  • Manual Effort: You would need to manually create these rewrites for every single product across your thousands of SKUs.
  • Error Prone: Manual processes are prone to errors and discrepancies.
  • Time-Consuming: Maintaining this manually will be a significant overhead as you add or update products.

The Efficient Solution: Configuring Magento’s Multistore URLs Properly

To solve this issue efficiently, we need to configure Magento to handle multistore URLs correctly. Here’s a step-by-step guide:

Step 1: Ensure Each Store Has Its Own Unique Base URL

In your Stores > Configuration > General > Web section, make sure each store has its own unique base URL.

  • For Site1 (Brand A): http://www.site1.com
  • For Site2 (Brand B): http://www.site2.com

Step 2: Update the Scope for Product URLs

By default, Magento uses a single product URL key across all views. To change this:

  1. Go to Stores > Configuration > Catalog > Catalog.
  2. Change the “Default Category Page” and “Use Categories Path for Product URLs” settings to “No”.
  3. Save the configuration.

This ensures each store will use its own unique URL structure for products.

Step 3: Handle URL Duplicates with a Custom Extension or Script

If you still encounter any duplicate URL issues (which shouldn’t happen if the above steps are followed correctly), you can handle them programmatically using a custom Magento extension or script:

  • Using an Extension: Develop a custom Magento extension that intercepts and rewrites URLs when needed. This could be part of your tech stack, especially if you have in-house development resources.

  • Using a Script: Write a one-time script (using PHP and the Magento API) to identify and rewrite any remaining duplicate URLs. This is best done during an off-hours maintenance window.

Conclusion: Configuration Over Customization

In this case, the solution lies not in customizing every individual URL, but in configuring Magento’s core multistore functionality correctly. By ensuring each store has its own unique base URL and adjusting the product URL scope settings, you can avoid the vast majority of duplicate URL issues.

Remember, Magento is a powerful platform designed to handle complex scenarios like this out-of-the-box, provided it is configured optimally.

For more in-depth guidance on managing multistore configurations in Magento 2, I recommend checking out:

These resources provide detailed walkthroughs and best practices to help you manage your multistore setup effectively.

Happy coding!

Magento 2 Catalog Themes Configuration

Our network