Language Prefix in OpenCart URLs

BonusGet bonus +100 грн. for your review

Download files

Characteristics
OpenCart3.0
PHP7.0 – 8.5
XML modificationYes
LocalizationEnglish, Ukrainian, Russian
Statistics 1180 39
Added04.03.2026
Updated04.03.2026 · 4 months ago
Files lang-dir-in-url.ocmod.zip

A language prefix in the URL adds a language folder to store links (e.g., /en/, /ua/ ) and automatically selects the language based on the first segment of the URL. As a result, each language version has its own clear address, and language switching and link generation work without broken routes or unnecessary 404s.

Compatible with ocStore 3.x only

Key Features

  • Determines the language by folder in the URL on all pages: home ( /en, /en/ ), catalog pages ( /en/product ) and links with parameters (UTM).
  • Fixes _route_ when SEO URL is enabled: removes the language folder from the route so that OpenCart can find the page correctly.
  • Automatically creates 301 redirects:
    • to the URL with the language folder, if there should be one (folder mode for the default language is enabled);
    • to a URL without a folder for the default language if the folder is disabled ( langdir_off ).
  • Adds the language folder to the links that OpenCart generates via url->link(), including the homepage (taking into account the SEO Pro slash option).
  • Processes search: if a search request is received without a language folder, the module will redirect to the correct URL with the required language.
  • Outputs hreflang tags to <head> (via extension/module/langdir controller) so that search engines understand the language versions of pages.
  • Substitutes different meta title/description/keywords for the main page by language (from the langdir_data settings).
  • Supports different addresses on the contact page by language (taken from langdir_data, otherwise - the standard config_address ).

Benefits for the store

  • Clear language URLs eliminate confusion: both the user and the bot immediately see the correct version of the site.
  • Fewer duplicates and 404s routes and redirects bring links to a uniform format.
  • Better international SEO hreflang + separate metadata for the homepage by language.
  • Correct links are everywhere even index.php?route=... are formed with the required language folder.

Application examples

  • You have 3 languages: /ua/, /en/, /pl/ - the module automatically switches the language by URL and brings the routes to the correct format.
  • The default language folder is not needed: when visiting /en/ (if en is the default language), the visitor will get a 301 for the URL without the folder.
  • Advertising links with UTM to the "language homepage" ( /en?utm_source=... ) correctly determine the language and do not break navigation.
File Name Added Modified
lang-dir-in-url.ocmod.zip
Size: 48.38 KB | Total downloads: 39
04.03.202604.03.2026

Leave your review about this product

Bonus Get bonus +100 грн. for your review Bonus program

Write a review

Note: HTML is not translated!
AI Assistant

Recently viewed

3.x
Language Prefix in URL
2.x, 3.x
Exchange 1C v8.x
Free
0
38745 13302

Featured