How to disable localized URLs?
⚠️ Compatibility Note
1. Update the Routing Configuration
🔍 What to Change
# config/routes/sylius_shop.yaml
sylius_shop:
resource: "@SyliusShopBundle/Resources/config/routing.yml"
- prefix: /{_locale}
- requirements:
- _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$
sylius_shop_payum:
resource: "@SyliusPayumBundle/Resources/config/routing/integrations/sylius_shop.yaml"
- sylius_shop_default_locale:
- path: /
- methods: [GET]
- defaults:
- _controller: sylius.controller.shop.locale_switch:switchAction✅ Final Configuration (After Applying the Diff)
2. Use Storage-Based Locale Switching
3. Adjust the Shop URL Regex for Security
🛡️ Add to config/packages/security.yaml
config/packages/security.yaml✅ Final Result
Before (Localized URL)
After (Clean URL)
Last updated
Was this helpful?
