Redirect based on language with PHP?

I have a website, one in English and one in Portuguese. I’d like to, when a user whose browser language is Portuguese accesses the English website, they should be redirected to the respective Portuguese version.

If user enters, he should be taken to
If they enter, take them to (notice that the URL path is also different)
and so on…

I’m really stuck. Can anybody suggest an approach for this?



will give you the browser language. You can then use PHP’s header() function.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.