Magento - URL rewrite to change language gives 404 error

Magento - URL rewrite to change language gives 404 error

October 2, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - URL rewrite to change language gives 404 error

Magento: Resolving URL Rewrite Language Translation Issues

Are you facing a 404 Not Found error when trying to translate Magento CMS pages using URL rewrites? You’re not alone. This common issue can be quite frustrating, but don’t worry - we’ll walk through the problem and provide a step-by-step solution for your specific scenario.

The Problem: Magento Language Switching Error

You’ve correctly identified that the issue arises when switching languages on a URL-rewritten page in Magento. Here’s what happens:

  1. You visit the Thai “Contact Us” page without any problems.
  2. When you switch to English, the URL redirects from /default/contact-us.html to /default/contact-us-eng, thanks to your URL rewrite setup.
  3. However, when you click on the language bar’s link for Thai (e.g., /thai/contact-us-eng?___from_store=default), Magento throws a 404 Not Found error.

The Root Cause

This issue often stems from how Magento handles multi-language support and URL rewrites. When you create URL rewrites, Magento doesn’t automatically account for language-specific targets. As a result, when switching languages, it can’t find the appropriate rewritten target for the new language.

The Solution: Fixing the 404 Not Found Error

To resolve this issue, we’ll need to make some adjustments to your Magento configuration and URL rewrite settings. Here’s how you can fix the 404 Not Found error:

Step 1: Enable Multi-Store Configuration

Ensure that your Magento installation is properly configured for multi-store setup. Go to Stores > Settings > All Stores, and check if both your English and Thai stores are listed with their respective codes (e.g., “default” for English and “thai” for Thai).

Step 2: Update URL Rewrite Target Paths

For each of your rewritten URLs, ensure that the target path is correctly specified. Here’s how to update them:

  1. Navigate to Catalog > URL Rewrite Management.
  2. Locate the entry for your page (e.g., contact-us).
  3. Click on “Edit” next to the entry.
<Target Path>
/contact-us.html
</Target Path>
  1. Change the target path format to include language-specific prefixes:

For English:

<Target Path>
default/contact-us.html
</Target Path>

For Thai:

<Target Path>
thai/contact-us.html
</Target Path>
  1. Save your changes.

Step 3: Clear Magento Cache

After updating the URL rewrite targets, make sure to clear your cache:

  1. Go to System > Tools > Cache Management.
  2. Click on “Flush Magento Cache.”

Conclusion: A Cleaner Checkout Experience

By following these steps and properly configuring your URL rewrites for multi-language support in Magento, you should be able to resolve the 404 Not Found error when switching languages.

Remember that proper management of URL rewrites is crucial for a smooth user experience across multiple languages. It ensures that your visitors can easily access translated content without encountering errors or broken links.

If you’re looking for more advanced Magento solutions and services, feel free to explore our offerings at Laravel Company. We specialize in custom development, e-commerce optimization, and strategic consulting to help businesses like yours unlock the full potential of the Magento platform.

Configuration Customers SEO Errors

Our network