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. Link to comment https://forums.phpfreaks.com/topic/95474-domain-redirect-language-dependent-help/ Share on other sites More sharing options...
kinaski Posted March 10, 2008 Author Share Posted March 10, 2008 Anyone??? Link to comment https://forums.phpfreaks.com/topic/95474-domain-redirect-language-dependent-help/#findComment-488821 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 } Link to comment https://forums.phpfreaks.com/topic/95474-domain-redirect-language-dependent-help/#findComment-489372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.