Feature No Code Attached Yet
avatar lipatovroman
lipatovroman
4 Mar 2023

Steps to reproduce the issue

We have multilingual site.
We configured the default language (English).
In Language Filter plugin configured Remove URL Language Code = Yes.
So, now we on main page and alternate languages displays correct. English version of the link does not have prefix /en/.

image

But Language switcher module contains the prefix /en/

image

Yes, when we select default English language, we'll get 301 redirect to the URL without prefix.
But it happens for all site URLs.
So, my site have 20K items and hundreds categories and 5 additional languages.
It means, that we're getting more than 100K 301 redirects just because module have not correct link to the default language page.

image

avatar lipatovroman lipatovroman - open - 4 Mar 2023
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Mar 2023
avatar lipatovroman lipatovroman - change - 5 Mar 2023
The description was changed
avatar lipatovroman lipatovroman - edited - 5 Mar 2023
avatar richard67 richard67 - change - 5 Mar 2023
Labels Added: ?
avatar richard67 richard67 - labeled - 5 Mar 2023
avatar richard67
richard67 - comment - 5 Mar 2023

That has been reported in past several times, see e.g. issues #26480 and #23144 , and several attempts to fix it have failed, see e.g. #23178 and #28265 , so the issues had been closed as expected behaviour. That's why I label this issue not as a bug but as a new feature.

avatar wojtekxtx
wojtekxtx - comment - 6 Mar 2023

@lipatovroman as of your first screeshot: URL for default lang does not include lang prefix because default language is mapped to site root (/). See .htaccess file

avatar lipatovroman
lipatovroman - comment - 12 Mar 2023

@lipatovroman as of your first screeshot: URL for default lang does not include lang prefix because default language is mapped to site root (/). See .htaccess file

I'm talking about link from the module. It's mapped to the site.com/en/ and then redirects to domain root.

avatar Hackwar Hackwar - close - 7 Apr 2024
avatar Hackwar Hackwar - change - 7 Apr 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-04-07 12:21:12
Closed_By Hackwar
Labels Added: Feature
Removed: ?
avatar Hackwar
Hackwar - comment - 7 Apr 2024

You reported this again as #41634. Since these are duplicate reports, I'm closing this one.

avatar lipatovroman
lipatovroman - comment - 2 May 2024

You reported this again as #41634. Since these are duplicate reports, I'm closing this one.

All my reports and all reports from other users were closed.
Problem not solved.
Someone wrote, that it's not a bug, it's a feature.
If this is a feature, so how to disable it?
I don't need thousands of 301 redirects on my site.
Google Search Console sends me alerts, that my site have too much 301 redirects.
Why alternate URLs are different with URLs from language module?
So, again. If it's a feature (strange, bad feature) - we should have ability to disable it.

avatar nikosfa
nikosfa - comment - 10 Feb 2025

Same problem in Joomla 5.
Has someone found the solution?
There should be a fix in this module, since this IS real problem for all Joomla sites, since this "feature" has very bad SEO consequences in multilingual sites.

avatar fgsw
fgsw - comment - 11 Feb 2025

@nikosfa Please comment at #41634 (it's the open Issue; comments on closed Issues like here are mostly ignored).

avatar Kycb27
Kycb27 - comment - 12 Feb 2025

Та же проблема в Joomla 5. Кто-нибудь нашел решение? Должно быть исправление в этом модуле, так как это РЕАЛЬНАЯ проблема для всех сайтов Joomla, так как эта "фича" имеет очень плохие последствия для SEO на многоязычных сайтах.

I changed the module a little, maybe my solution will help:
src/modules/mod_languages/src/Helper/LanguagesHelper.php

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Plugin\PluginHelper;
$default_lang = ComponentHelper::getParams('com_languages')->get('site', 'en-GB');
$plugin = PluginHelper::getPlugin('system', 'languagefilter');
$pluginParams = json_decode($plugin->params);

 if ($multilang) {
...
  if ($pluginParams->remove_default_prefix && $language->lang_code === $default_lang) {
                        $language->link= preg_replace('|/' . $language->sef . '/|', '/', $language->link, 1);
                    }
}

Add a Comment

Login with GitHub to post a comment