Forum Moderators: phranque
I have two sites(both hosted on same server using virtual directories):
www.example.com (English Site)
www.example.de (German)
I'm developing www.example.de right now. When a user directly types in www.example.com and if their browser language is set to german, i want them to be redirected to www.example.de.
If the user is coming to example.com through a referal AND their browser is german than no redirect.
is this possible?
Users prefer the solution of selecting by TLD (.com or .de) first, and using an on-screen option (like clicking on country name, language, or even national flags) second. You can save this preference as a cookie and then test it using mod_rewrite in .htaccess or from PHP or any server-side script as %{HTTP_COOKIE}. You have no guarantee that the browser language preference has been set by the user, so don't count on it -- Think internet cafes, Germans visiting London, and Englishmen working in Berlin.
Jim