• // Visiting url is http://domain.com/en (and ‘en’ is not the default language)

    // Problem:
    bloginfo(‘url’); // outputs ‘http://domain.com/en/en’ which is a 404

    // Possible solution:
    // in qtrans_convertURL – mqtranslate_core.php

    // behind:
    // check for query language information and remove if found
    if(preg_match(“#(&|\?)lang=([^&\#]+)#i”,$url,$match) && qtrans_isEnabled($match[2])) {
    $url = preg_replace(“#(&|\?)lang=”.$match[2].”&?#i”,”$1″,$url);
    }

    // added:
    // check for language path prefix and remove if found
    if($url == ‘/en’) {
    $url = ”;
    }

    Best regards,
    Sander

    https://wordpress.org/plugins/mqtranslate/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘double language path in bloginfo('url')’ is closed to new replies.