I am using polylang plugin for wordpress multi language site.
As per SEO guidelines, home page www.myweb.com should redirect to www.myweb.com/en with 301 status. Currently its redirecting with 302 status.
function home_requested() does this but we can’t touch the plugin core functions.
I tried by adding filter for this function. Also tried by add filter for wp_redirect function but not working.
Is there any other way to sort this. Thank you.
3
Answers
You probably fixed this already, however, posting for other people that are looking to solve this issue.
I solved it by editing the choose-lang.php file in the plugin
wp-content->plugins->polylang->frontend->choose-lang.php :277 or do a ctrl + f for 302 and replace that with 301.
I tested below code working fine.
Add below code in functions.php file
i tested functions.php not work for me.
nano /polylang/frontend/choose-lang.php (line +265)
change 302 to 301. you done.
and it will reset itself after any polylang update