Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] SEF and multilingual. The hreflang tag pointing to itself is missing. #44297

Open
david-fores opened this issue Oct 17, 2024 · 0 comments

Comments

@david-fores
Copy link

david-fores commented Oct 17, 2024

Steps to reproduce the issue

Global configuration > SEO
Search Engine Friendly URLs: Yes
Use URL Rewriting: Yes

Plugins > System - SEF
Site Domain: https://www.example.com
Enforce a suffix by redirect: Yes
Strict handling of index.php: Yes
Trailing slash for URLs: Enforce URLs without trailing slash
Strict Routing: Yes

Create a multilingual site with the associations between articles, categories and menus correctly set up.
For example, 2 menus for English and Spanish, with a blog menu item and 2 articles. English is the default language.

English:
https://www.example.com/en/blog/article-1-en
https://www.example.com/en/blog/article-2-en

Spanish:
https://www.example.com/es/blog/article-1-es
https://www.example.com/es/blog/article-2-es

Expected result

If article 1 is accessed from the English menu:
https://www.example.com/en/blog/article-1-en

In the source code there should be 2 language association tags (English and Spanish language), another one for the default language and the canonical URL tag.

<link href="https://www.example.com/en/blog/article-1-en" rel="alternate" hreflang="en">
<link href="https://www.example.com/es/blog/article-1-es" rel="alternate" hreflang="es">
<link href="https://www.example.com/en/blog/article-1-en" rel="alternate" hreflang="x-default">
<link href="https://www.example.com/en/blog/article-1-en" rel="canonical">

Actual result

Currently the hreflang tag of the language itself is replaced by the canonical URL tag.

<link href="https://www.example.com/en/blog/article-1-en" rel="canonical">
<link href="https://www.example.com/es/blog/article-1-es" rel="alternate" hreflang="es">
<link href="https://www.example.com/en/blog/article-1-en" rel="alternate" hreflang="x-default">

If the "Site Domain" field is left empty (Plugins > System - SEF), in this case the language association tags are added but not the canonical URL tag.

<link href="https://www.example.com/en/blog/article-1-en" rel="alternate" hreflang="en">
<link href="https://www.example.com/es/blog/article-1-es" rel="alternate" hreflang="es">
<link href="https://www.example.com/en/blog/article-1-en" rel="alternate" hreflang="x-default">

System information (as much as possible)

PHP Version: 8.3.6
Database Version: 10.6.17-MariaDB
Web Server: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.6
WebServer to PHP Interface: apache2handler
Joomla! Version: Joomla! 5.2.0 Stable [ Uthabiti ] 15-October-2024 16:00 GMT

No external plugins installed.

Additional comments

From Google documentation:
Google documentation. International and multilingual

"Each language version must list itself as well as all other language versions."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants