kinaski Posted March 10, 2008 Share Posted March 10, 2008 Hello to all! I'm trying to setup my new php site, which is bilingual (english/french) in a way that each of the separate language versions use different domains (which I already have - two domains and one install of the site). Right now my site is functioning with manual language switching. Thou I'm not good enough with php I suppose that the language versions are maintained on the session level (but I'm not s sure). Anyway I got something like this when I select the language drop down: .mysite.com/index.php?lang=english for english and .mysite.com/index.php?lang=french for french version. What I want to do is apply some kind of apache/php redirects in my site so that when users select english domain(www.mysite.com) the english language is automatically selected, and when they go to the french domain(www.monsite.com) to switch to french version. How can I do this? I got this response from other forum: if(FALSE !== strpos($_SERVER['HTTP_HOST'], 'www.mysite.com')) { // do french stuff } else { // do english stuff } But the guy wasn't available for me to explain me this code, so I can't really make it work I would be very very thankful if someone out there point me to the right direction. Thank you in advance. Quote Link to comment Share on other sites More sharing options...
kinaski Posted March 10, 2008 Author Share Posted March 10, 2008 Anyone??? Quote Link to comment Share on other sites More sharing options...
skidz Posted March 11, 2008 Share Posted March 11, 2008 try: if(strpos($_SERVER['HTTP_HOST']) !== 'www.mysite.com') { // do french stuff } else { // do english stuff } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.