I have site www.evodie-art.com, this site was made by myself with no experience in site development. To increase accessibility, I use multiple server in USA, Germany, and Singapore using index.php: <?php $country = geoip_country_code_by_name($_SERVER["REMOTE_ADDR"]); if ($country == "ID") { echo"<script language='javascript'>location.href='http://www.evodie-art.com/index.html';</script>"; } else if ($country == "US") { echo"<script language='javascript'>location.href='http://us.evodie-art.com/index.html';</script>"; } else if ($country == "SG") { echo"<script language='javascript'>location.href='http://sg.evodie-art.com/index.html';</script>"; } else if ($country == "DE") { echo"<script language='javascript'>location.href='http://eu.evodie-art.com/index.html';</script>"; } else { echo"<script language='javascript'>location.href='http://www.evodie-art.com/index.html';</script>"; } ?> How do I know that index.php work correctly?
To test your page, input different IP addresses from different countries instead of using $_SERVER["REMOTE_ADDR"]. This will tell you if your script changes to your desired website properly. Then test $_SERVER["REMOTE_ADDR"] itself to make sure it gets the user's IP and not your web host's (With some web hosts, you must bypass their proxy). Check $_SERVER["REMOTE_ADDR"] and make sure it atleast gets your IP correctly.