0

Thanks for your time. Just like the title, what I need to accomplish is that

Whenever someone in the South Korea visit my site http://awebsite.com/ they will automatically goes to http://awebsite.com/kr/index.html instead of http://awebsite.com/index.html (so basically the "kr" folder)

If its from South Korea, then they will be automatically point towards /kr/ folder instead.

How to achieve the above?

Thank you

Sarah
  • 329
  • 5
  • 21
  • This might help you https://stackoverflow.com/questions/3489460/how-to-get-visitors-location-i-e-country-using-geolocation – Bryan Jun 02 '20 at 09:58
  • https://www.w3schools.com/html/html5_geolocation.asp this can help you to get geolocation and then you can redirect. – Avinash Dalvi Jun 02 '20 at 09:59

1 Answers1

0

One way to achieve this is to use an IP detection API (for example, ip-api.com, there are many similar services) to detect the location of the client, and when South Korea is detected as the location of the client, use window.location.replace(...) as described in this answer.

Rtzoor
  • 308
  • 2
  • 11