Different URL keys for different language CMS pages

Different URL keys for different language CMS pages

July 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Different URL keys for different language CMS pages

Solving Multilingual Redirect Issues in Magento

If you’re setting up a multilingual Magento store, one common challenge is linking CMS pages across different languages without confusing your users or breaking the URLs. The default approach of using the same URL key for all languages might seem like an easy solution, but it often leads to poor user experience and doesn’t meet modern SEO best practices.

Understanding the URL Key Problem

In your example, you correctly identified that using a single URL key like /about-us for both English and German pages would lead to a 404 error when a German user switches their language. The German equivalent page is located at /ueber-uns, so any attempts to access /about-us in the German storefront will fail.

Why Same URL Key Isn’t Always Ideal

While using the same URL key ensures consistency, it has several drawbacks:

  1. Poor User Experience: Users expect URLs to match the language they’re viewing.
  2. SEO Issues: Search engines prefer URLs that clearly indicate content language and structure.
  3. Internationalization Challenges: As you scale your store internationally, maintaining consistent URL keys becomes impractical.

A Better Multilingual Redirect Strategy

Instead of forcing a single URL key across all languages, consider implementing a more flexible redirect strategy:

  1. Unique URL Keys for Each Language: Assign unique, language-specific URL keys to each CMS page version.
  2. Language-Based Redirects: Implement redirects based on the user’s selected language.

Here’s a high-level approach to achieving this using Magento’s built-in features and some custom development:

Step 1: Create Separate CMS Pages for Each Language

For your “About us” example, create two separate CMS pages - one in English (about_us_en) and one in German (ueber-uns_de).

Step 2: Use Language-Based Attributes for URL Keys

When creating the CMS pages, use a language-based attribute or custom field to store the corresponding URL key for each version. For instance:

  • English page:

    • Title: About Us
    • Content: Your English content here…
    • URL Key Attribute (custom): about-us
  • German page:

    • Title: Über uns
    • Content: Ihr deutscher Inhalt hier…
    • URL Key Attribute (custom): ueber-uns

Step 3: Implement Language-Based Redirects

To automatically redirect users to the appropriate language version of a CMS page, you can use Magento’s observer pattern and event system.

Create an event observer that triggers when a user changes their storefront language. In this observer, check if the requested URL exists in any other language versions:

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $request = $observer->getRequest();
    $controllerAction = $observer->getControllerAction();

    $currentUrlPath = trim($request->getOriginalPathInfo(), '/');
    $allStores = $this->_storeManager->getStores();

    foreach ($allStores as $store) {
        $urlKey = $this->getUrlKeyForStore($store, $currentUrlPath);

        if (!empty($urlKey)) {
            return $controllerAction->redirect($request->getBaseUrl() . ltrim($urlKey, '/'));
        }
    }

    // If no redirection found, continue with the original request
}

private function getUrlKeyForStore($store, $currentUrlPath)
{
    // Implement logic to fetch and map CMS page URL keys for each store/language
}

This observer compares the requested URL path against known URL keys across all available stores. If a match is found in the user’s current language preference, it redirects them accordingly.

Conclusion

Implementing this approach allows you to maintain unique, language-specific URLs while providing seamless redirects between multilingual CMS pages. This strategy improves user experience, enhances SEO relevance, and supports internationalization as your business grows.

For more detailed guides on Magento’s event observer system and custom URL handling, check out our comprehensive tutorials at Laravel Company.

Remember to thoroughly test this setup in a staging environment before deploying it to your live store. With proper configuration, you can create a robust multilingual experience that meets both user and search engine expectations.

Happy coding!

Configuration SEO Errors

Our network