Project

General

Profile

Bug #2188

Sitemap URLs generated incorrectly when 2 languages exist and languages selection is disabled

Added by Batyr Mackenov about 2 years ago. Updated 7 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Core
Target version:
Start date:
July 07, 2015
Due date:
% Done:

0%


Description

Despite of inactivity of the second language, URLs for sitemap generated including language prefix.

For example, if you have only one active language, you anyway get URLs like below:

/de/blog/
/de/login/
/de/profile/
/de/search/

History

#1 Updated by Vasily Bezruchkin about 2 years ago

This should be discussed. Probably if we change this we will have issues with redirection later, when we translate a language but the URLs become indexed without language prefix. This might be the cause of SEO problems.

#2 Updated by Vasily Bezruchkin about 2 years ago

  • Target version changed from 3.3.5 to 4.0.0

#3 Updated by Vasily Bezruchkin about 2 years ago

  • Target version changed from 4.0.0 to 4.3.0

#4 Updated by j b over 1 year ago

one of the ways to solving this trouble (v 4.0.5):
includes\classes\ia.admin.sitemap.php
row 196
change:

if (empty($url))
to:
if (empty($url) && $page['name'] !== $homePageName)

rows 207-215 to:
$rez = '';
$currentLanguage = $this->iaView->language;
foreach ($this->iaCore->languages as $code => $title) {
    if ($code != $currentLanguage) {
        // potentially buggy. replaces all (!) of entries in URL
        $rez .= str_replace(IA_URL_DELIMITER . $currentLanguage . IA_URL_DELIMITER, IA_URL_DELIMITER . $code . IA_URL_DELIMITER, $result);
    }
}
$result = $result . $rez;

#5 Updated by Vasily Bezruchkin 9 months ago

  • Target version changed from 4.3.0 to 4.1.0

#6 Updated by Vasily Bezruchkin 7 months ago

  • Target version changed from 4.1.0 to 4.3.0

Also available in: Atom PDF