Country Redirect To Sub-Domains

I have subdomains point to same root, when user enter the main domain redirected to subdomian depending on

his country location ex :

1- user enter

2- detect country = italy

3- redirected to subdomain

and thank you .


what is your issue ? Do you want to know how detect a country ?

or how to redirect after of detecting ?