How To Make Country Wise Website on Same Domain

Country Wise Website Using PHP | Hello everyone ,welcome to another fresh article ,in this article I will teach you how to make a simple country wise website on php, for example, visitor visit your website in India, so it’s automatic redirect to India version like and if visitor visit your website outside of India like in us and another country so it automatically redirects to root domain or

it’s a very simple process, here is simple code, you can use in your index file, just copy and paste below code in your website index file it’s automatic worked, on India and us ,also you can modify this code as per your choice ,mean’s you can add more country on switch case.

Note: Learn in details about making this type website, so you need to watch below video, so please watch below video, video language is hindi, I will try to add subtitles soon.


  $user_ip = getenv('REMOTE_ADDR');
  $geo = unserialize(file_get_contents("$user_ip"));
  $country = $geo["geoplugin_countryName"];

  switch ($country) {
    case "India":
    case "United States":


Watch a Video

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

Editorial Staff at Veewom is a Team of Experts led by Bharat Makvana.

You may also like this!