• Hello, want to get some help regarding redirects from “domain.com” to “domain.com/en/” for example.

    How to get a 301 redirect of main domain “domain.com” instead of 302.

    On my website the main domain is getting Status: 302 Found.

    How can I change that to a normal status like “200 ok”?

    Thank you in advance.

    This is caused only by polylang plugin.

    https://www.ads-software.com/plugins/polylang/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    302 is the default redirection made by WordPress. You can use the filter wp_redirect_status to change it.

    You can also avoid redirection by removing language code for the default language and not redirecting according to browser preferences (both in Polylang settings).

    Thread Starter andres.t2005

    (@andrest2005)

    Thank you for response! I have disabled the language code for default language, and this solved my problem.

    But want to try with wp_redirect_status because want to show my visitors what language is used for this site, if you understand my idea.

    Where I can locate this filter to change the status of redirect?

    Thank you in advance.

    Thread Starter andres.t2005

    (@andrest2005)

    Have modified it from default 302 to 301, now when I’m inspecting is showing status: 301 Moved Permanently.

    Plugin Author Chouby

    (@chouby)

    Yes that’s what I would expect.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘polylang and 302 redirects’ is closed to new replies.