• Hello!

    When redirecting from tld.com to tld.com/en, the plugin sets a 302 header (Moved temporarly).

    This should be clearly 301 (Moved permanently).

    The function that causes this is in

    frontend/choose-lang.php:263

    wp_redirect( $redirect );

    If you change it to

    wp_redirect( $redirect, 301 );

    everything works.

    All hooks/actions are too late, so this cannot be modified in the functions.php theme file.

    Any chances that the plugin author integrates that in a future version?

Viewing 4 replies - 1 through 4 (of 4 total)
  • This should be pinned at the top of the support forum for Polylang – this resolves a huge seo issue.

    Definitely should be considered for the next plugin build as well IMO.

    For our website we chose to completely remove the redirect on homepage. Now both homepage and homepage/en display the same content (no redirection).And homepage/en is set as canonical.
    Hopefully this will solve ahuge problem we’re having with Polylang: all google searches with keywords in other languages than the default language for the website (which is English) results in only our English pages being displayed in the search result. This means that our German market, for example, is completely unaware of our existentce. If anyone else has this huge SEO issue with Polylang, please comment on solutions you found.

    For our website we chose to completely remove the redirect on homepage. Now both homepage and homepage/en display the same content (no redirection).And homepage/en is set as canonical.

    did you have to hack polylang for that? I don’t think there are any settings for that.

    I also have a similar issue that homepage/ is chosen as canonical by google instead of homepage/defuault-language, which, as far as I understand, is related to 302 redirects instead of 301.

    Any reason why there could not be a plugin option to do 301 instead?

    p.s. looks like recommended workaround is to simply hide default language and don’t do auto redirect https://www.ads-software.com/support/topic/302-page-moved-google-cannot-fetch-webpage-with-polylang/#post-3017188

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect header 301 instead of 302’ is closed to new replies.