No Code Attached Yet
avatar david-fores
david-fores
17 Oct 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."

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar david-fores david-fores - open - 17 Oct 2024
avatar david-fores david-fores - change - 17 Oct 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Oct 2024
avatar david-fores david-fores - change - 17 Oct 2024
The description was changed
avatar david-fores david-fores - edited - 17 Oct 2024
avatar david-fores david-fores - change - 17 Oct 2024
The description was changed
avatar david-fores david-fores - edited - 17 Oct 2024

Add a Comment

Login with GitHub to post a comment