Redirect to another language
Mar 13, 2016 11:10 am by olegthered
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 = 'http://tracers.ru' . $_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
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
Mar 13, 2016 6:15 pm by olegthered
Hi,
yes, I already made it. But I can't send user to tracers.ru from en.tracers.ru. It stays/returns on en.tracers.ru. May be language variable should be changed?
Re: Redirect to another language
Mar 13, 2016 9:13 pm by Edvard
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!
SIMILAR TOPICS
Large numbers of crawl errors with double language code | Jan 24, 2019 1:43 am | Replies: 1 | Post by: natastna2 |
Translate website to any specific language, on page load | Jan 19, 2019 6:49 am | Replies: 1 | Post by: Leaon7756 |
Graphic translation for every language is missing | Dec 19, 2018 7:54 am | Replies: 1 | Post by: Daryl Dixon |
How to remove mobile Language Select Button transparency | Dec 5, 2018 10:06 pm | Replies: 10 | Post by: JeffTR |
Change language automatically | Nov 26, 2018 9:29 pm | Replies: 3 | Post by: Antilb |