Forum Archive - Redirect to another language

Redirect to another language
Mar 13, 2016 11:10 am by olegthered
Hello, I would like to make auto redirect for users from another countries but when I use: -- $new_url = '' . $_SERVER['REQUEST_URI']; wp_redirect( $new_url, 301 ); -- nothing happens. This code was used to redirect russian user that went to eng version. I would like to implement geo autodetect for first visit and change lang but then language choosing will be still possible. I made it via session variables but I can't succeed with redirect.
Re: Redirect to another language
Mar 13, 2016 4:41 pm by Yana
Hi, We do not recommend using auto detect feature and it is not included in Enterprise version. However, if you want that feature, it is possible to code on your end. You can use the geo ip DB and some custom scripting . You should use X-Real-IP to detect visitor location and change the language.
Re: Redirect to another language
Mar 13, 2016 6:15 pm by olegthered
Hi, yes, I already made it. But I can't send user to from It stays/returns on May be language variable should be changed?
Re: Redirect to another language
Mar 13, 2016 9:13 pm by Edvard
Hi, Your code should use cookies to handle that. I want to mention again that it is not recommended, you may have troubles with search engines. Thanks!


Large numbers of crawl errors with double language codeJan 24, 2019 1:43 amReplies: 1Post by: natastna2
Translate website to any specific language, on page loadJan 19, 2019 6:49 amReplies: 1Post by: Leaon7756
Graphic translation for every language is missingDec 19, 2018 7:54 amReplies: 1Post by: Daryl Dixon
How to remove mobile Language Select Button transparencyDec 5, 2018 10:06 pmReplies: 10Post by: JeffTR
Change language automaticallyNov 26, 2018 9:29 pmReplies: 3Post by: Antilb

Try GTranslate with a free 15 day trial