There is a one-page site on Drupal (although CMS probably does not matter), it is necessary that, depending on the city, a certain page opens. What is the best way to do this?

Closed due to the fact that the essence of the question is not clear by the participants of MasterAlex , dirkgntly , Denis , aleksandr barakin , pavel 30 Aug '16 at 12:37 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    And what have you done, except that you posted a question here? Did the search on the Internet did not give a single solution? - MasterAlex
  • Mostly they recommend multisiting, but since I have a one-page site, I may have the opportunity to implement it inside the site. - Valery
  • I inserted your words from the question into the search and immediately found such a module: drupal.org/project/geoip , I did not see any multisiting - MasterAlex

1 answer 1

Alternatively, you can use the service http://ipgeobase.ru:7020/geo?ip=Your_IP , and then parse the desired data.

<?php $ip = $_SERVER['REMOTE_ADDR']; $res = file_get_contents('http://ipgeobase.ru:7020/geo?ip='.$ip); 
  • The answer is good, but you should add a timeout for the request and nache, when the service crashes, the site will fall. - Naumov