Hello.
For example, we have 6 languages on the site.
Default language is English.
When we are on Spanish site version (site.com/es/), alternate URLs looks ok:
<link href="https://site.com/" rel="alternate" hreflang="en-GB">
<link href="https://site.com/fr/" rel="alternate" hreflang="fr-FR">
<link href="https://site.com/de/" rel="alternate" hreflang="de-DE">
Note the URL of the English version of the site.
It does not contain the language in the URL.
But language module contain another URL to default language.
<a href="/en/"> English </a>
And this URL have 301 redirect to site.com
Google Search Console displays a warning about thousands of pages with 301 redirects.
I tried to replace language from the URL with code:
<?php
$no301 = str_replace("/en/", "", $language->link);
?>
And it's working.
But if we are on the home page of any language other than English, it is impossible to switch to the English version.
It has long been known that internal 301 redirects are bad for SEO and are considered a technical problem that should be fixed.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I tried this option.
No matter if it enabled or disabled.
Language module always displays URL site.com/en/ instead of site.com
and when it is disabled then all languages will display /langcode/ and trhere is no redirect?
Exactly.
When it's disabled, all URLs contains /en/ for default language.
And when we're switching from another language's - no any redirects.
site.com/es/ to site.com/en/ = 200
When it's enabled:
site.com/es/ to site.com/en/ = 301 to site.com
In the same time, alternate links are correct:
<link href="https://site.com/" rel="alternate" hreflang="en-GB">
<link href="https://site.com/fr/" rel="alternate" hreflang="fr-FR">
<link href="https://site.com/de/" rel="alternate" hreflang="de-DE">
This creates a huge number of 301 redirects, especially on large sites.
And this is a very serious problem for SEO.
so dont enable it and the problem is solved?
so dont enable it and the problem is solved?
Of course no )))
At first, it's a serious bug. It should be fixed.
I'm sure many webmasters with multi-language sites don't even know about this problem.
Personally, I found out about it by accident 2 years later when Google sent me an email saying there were problems with the site that needed to be fixed, a large number of redirects.
Next, in my case. I have a very big site, which already indexed by all search engines.
And now English site version have URLs like
https://directory.audio
https://directory.audio/sound-effects
https://directory.audio/free-music
If I disable this option, thousands pages will be redirected back, from
https://directory.audio/free-music
to https://directory.audio/en/free-music
Labels |
Added:
Feature
|
Yes, the behavior of Joomla is strange here. It is how it has been working for a decade or longer now. I wouldn't exactly call this a bug, but indeed it should be looked at if we change this behavior and improve it, making this a feature.