Redirect to another language

Popular automatic website translation tool

Redirect to another language

Postby olegthered » Sun Mar 13, 2016 3:10 pm

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.
olegthered
 
Posts: 80
Joined: Thu Feb 26, 2015 11:52 am

Re: Redirect to another language

Postby Yana » Sun Mar 13, 2016 8:41 pm

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.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm

Re: Redirect to another language

Postby olegthered » Sun Mar 13, 2016 10:15 pm

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?
olegthered
 
Posts: 80
Joined: Thu Feb 26, 2015 11:52 am

Re: Redirect to another language

Postby Edvard » Mon Mar 14, 2016 1:13 am

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!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests