0

I would like to ask for advice. I have request to set up my website to redirect to language of the user.

The default language of web-page is CZ.

And the request is , if somebody visit website, who is not from CZ, then open EN Version.

first I find out from IP address the code of country.

And after I know the country Code I wanted to setup condition:

   if ($countryCODE == 'CZ') {

   } else { 
      echo '<script>location.href="?&EN"</script>'; 
   } 

But obviously I got cycled.

How is the best way to solve it?

Another condition is that if a non-CZ user decides to switch to Czech Version, he needs to be able to browse CZ Version even if his countryCode is not CZ.

greatwolf
  • 20,287
  • 13
  • 71
  • 105
Rolly
  • 3
  • 3

0 Answers0