Forums

Polylang
[resolved] Homepage language autodetect redirects to not pretty URLs (3 posts)

  1. bitbusters
    Member
    Posted 3 months ago #

    Hi Chouby!
    I've got the polylang version you have developed a week ago (http://wordpress.org/support/topic/plugin-polylang-custom-type-posts-not-found-with-pretty-permalinks-urls?replies=6)
    and with pretty permalinks enabled, the when visiting the home page from a browser with a language different that polylang default, I get redirected to homesite.com/?lang=de instead of homesite.com/de/
    All other (header & footer) homepage links are OK - only the language autodetect rediretion.

    If you've already correct it - sorry, but I haven't test it yet. Cheers :)

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Posted 3 months ago #

    Could you please try this ?
    Edit the file include/core.php at line 252 (in v0.7) - just before wp_redirect($url); - and replace:

    $url = home_url('?lang='.$this->curlang->slug);

    by

    $url = $this->add_language_to_link(home_url(), $this->curlang);
  3. bitbusters
    Member
    Posted 3 months ago #

    Thanks! It works! I admire the way you manage your code to be able to trace and debug all those tiny details...

Reply

You must log in to post.

About this Plugin

About this Topic