Jump to content

Domain redirect (language dependent) help!


kinaski

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.