SEO Url in Version 5.2.4 nicht korrekt?

Hallo Zusammen,

wir werden vorraussichtlich nächste woche eine neue Version veröffentlichen in dem wir diesen Bug behoben haben.

In der Zwischenzeit könnt ihr folgenden quickfix benutzen.

In der Dateil engine/Shopware/Core/sRewriteTable.php in Zeile 196 (Mehode ist sCleanupPath) folgendes einfügen:

// replace -html with .html at the end of the string
if (substr($path, -5, 5) === '-html') {
    $path = substr_replace($path, '.html',-5, 5);
}

Die gesamte methode sollte nun so aussehen:

public function sCleanupPath($path, $remove_ds = true)
{
    // replace forward slash to dashes in strings like "Help / Support"
    // to not create unnecessary directory levels
    $path = preg_replace("#\s/\s#", "-", $path);

    $parts = explode("/", $path);
    $parts = array_map(function ($path) {
        return $this->slug->slugify($path);
    }, $parts);
    $path = implode("/", $parts);

    if (substr($path, -5, 5) === '-html') {
        $path = substr_replace($path, '.html',-5, 5);
    }

    return $path;
}

 

Alternativ habe ich diesen Fix auch in Form eines Plugins. Dies kann einfach über den Plugin-Manager im Backend installiert und aktiviert werden: https://tempfile.me/dl/73apPNItqSYWmc/.

 

Viele Grüße,

Benjamin Cremer  Shopware