Hi everybody, I'm setting a new site in 2 languages French- English. The main site is in French: httt://mainsite.com the second language (english) is in a subfolder: httt://mainsite.com/en I'm looking for a Javascript that detect and redirect to newsite(.)com/en all the users that aren't french and of course allow the french users go to the main site newsite(.)com Could you please help me? Thanks in advance
What would be your logic to identify the users that aren't french? Anyways, I would suggest following: 1. Use server side checking in PHP. 2. Based on IP address of user, check which country user belongs to. 3. If user is from France, show default page, else redirect to /en 4. You can also give option to set default language and drop it in cookie which you can read before doing IP to country check. For IP to Country mapping, you can use MaxMind database.