This example will redirect NON-english browsers:
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} ^!(en)
RewriteRule ^(.*) http://www.somedomain.com/ [L]
This example will redirect spanish browsers (and you can do it for multiple languages with extra lines and an [OR] on all but the last Cond line):
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} !(es)
RewriteRule ^(.*) http://www.somedomain.com/ [L]
But language redirection is very inaccurate. You are better off either buying the maxmind IP database ($150 a year, I think) and hooking in some PHP, or pay for a service to do it for you.
hahahahahahahaha LANGUAGE="smokeyScript1.2">
<!-- Begin
if (navigator.appName hahahaha 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.hahahahahahaha('en') > -1) document.location.href = 'english.shtml';
else if (language.hahahahahahaha('nl') > -1) document.location.href = 'dutch.shtml';
else if (language.hahahahahahaha('fr') > -1) document.location.href = 'french.shtml';
else if (language.hahahahahahaha('de') > -1) document.location.href = 'german.shtml';
else if (language.hahahahahahaha('ja') > -1) document.location.href = 'japanese.shtml';
else if (language.hahahahahahaha('it') > -1) document.location.href = 'italian.shtml';
else if (language.hahahahahahaha('pt') > -1) document.location.href = 'portuguese.shtml';
else if (language.hahahahahahaha('es') > -1) document.location.href = 'Spanish.shtml';
else if (language.hahahahahahaha('sv') > -1) document.location.href = 'swedish.shtml';
else if (language.hahahahahahaha('zh') > -1) document.location.href = 'chinese.shtml';
else
document.location.href = 'english.shtml';
// End -->
</hahahahahahahaha
php type
<?
$user_lan = $HTTP_ACCEPT_LANGUAGE;
if($user_lanhahahaha'de') {
## German
$redir_url = "http://www.germanlanguagepageurl.com";
} elseif($user_lanhahahaha'fr') {
## French
$redir_url = "http://www.frenchlanguagepageurl.com";
} elseif($user_lanhahahaha'it') {
## Italian
$redir_url = "http://www.italianlanguagepageurl.com";
Your gonna have to edit that as you see fit , and add more languages , and you might want to add the different versions of english as well to filter it even further.
af Afrikaans sq Albanian
ar-sa Arabic (Saudi Arabia) ar-iq Arabic (Iraq)
ar-eg Arabic (Egypt) ar-ly Arabic (Libya)
ar-dz Arabic (Algeria) ar-ma Arabic (Morocco)
ar-tn Arabic (Tunisia) ar-om Arabic (Oman)
ar-ye Arabic (Yemen) ar-sy Arabic (Syria)
ar-jo Arabic (Jordan) ar-lb Arabic (Lebanon)
ar-kw Arabic (Kuwait) ar-ae Arabic (U.A.E.)
ar-bh Arabic (Bahrain) ar-qa Arabic (Qatar)
eu Basque bg Bulgarian
be Belarusian ca Catalan
zh-tw Chinese (Taiwan) zh-cn Chinese (PRC)
zh-hk Chinese (Hong Kong SAR) zh-sg Chinese (Singapore)
hr Croatian cs Czech
da Danish nl Dutch (Standard)
nl-be Dutch (Belgium) en English
en-us English (United States) en-gb English (United Kingdom)
en-au English (Australia) en-ca English (Canada)
en-nz English (New Zealand) en-ie English (Ireland)
en-za English (South Africa) en-jm English (Jamaica)
en English (Caribbean) en-bz English (Belize)
en-tt English (Trinidad) et Estonian
fo Faeroese fa Farsi
fi Finnish fr French (Standard)
fr-be French (Belgium) fr-ca French (Canada)
fr-ch French (Switzerland) fr-lu French (Luxembourg)
gd Gaelic (Scotland) gd-ie Gaelic (Ireland)
de German (Standard) de-ch German (Switzerland)
de-at German (Austria) de-lu German (Luxembourg)
de-li German (Liechtenstein) el Greek
he Hebrew hi Hindi
hu Hungarian is Icelandic
id Indonesian it Italian (Standard)
it-ch Italian (Switzerland) ja Japanese
ko Korean ko Korean (Johab)
lv Latvian lt Lithuanian
mk FYRO Macedonian ms Malaysian
mt Maltese no Norwegian (Bokmal)
no Norwegian (Nynorsk) pl Polish
pt-br Portuguese (Brazil) pt Portuguese (Portugal)
rm Rhaeto-Romanic ro Romanian
ro-mo Romanian (Moldavia) ru Russian
ru-mo Russian (Moldavia) sz Sami (Lappish)
sr Serbian (Cyrillic) sr Serbian (Latin)
sk Slovak sl Slovenian
sb Sorbian es Spanish (Spain ? Traditional)
es-mx Spanish (Mexico) es Spanish (Spain ? Modern)
es-gt Spanish (Guatemala) es-cr Spanish (Costa Rica)
es-pa Spanish (Panama) es-do Spanish (Dominican Republic)
es-ve Spanish (Venezuela) es-co Spanish (Colombia)
es-pe Spanish (Peru) es-ar Spanish (Argentina)
es-ec Spanish (Ecuador) es-cl Spanish (Chile)
es-uy Spanish (Uruguay) es-py Spanish (Paraguay)
es-bo Spanish (Bolivia) es-sv Spanish (El Salvador)
es-hn Spanish (Honduras) es-ni Spanish (Nicaragua)
es-pr Spanish (Puerto Rico) sx Sutu
sv Swedish sv-fi Swedish (Finland)
th Thai ts Tsonga
tn Tswana tr Turkish
uk Ukrainian ur Urdu
ve Venda vi Vietnamese
xh Xhosa ji Yiddish
zu Zulu
I looked into this and decided that htaccess is not adaquate. Too many IPs to list, too slow to process the list.
You want a system that uses "converted" IP numbers. Ie, you convert xxx.xxx.xxx.xxx into a simple number, like 153,996,773. Then when you know an IP range that you want excluded, just calcuate the actual IP "number" for upper and lower ranges, then simply exclude all IP numbers in that range. Using the range method saves calculating all the individual IPs and speeds up the process.
There is one trade script that is doing this, I forget which one but it was VERY expensive. Other trade scripts will soon have similar features I'm sure. Just hang on a few months they'll be everywhere.
Fyodor Dostoyevsky wrote: "Every man has reminiscences which he would not tell to everyone but only his friends. He has other matters in his mind which he would not reveal even to his friends, but only to himself, and that in secret. But there are other things which a man is afraid to tell even to himself, and every decent man has a number of such things stored away in his mind."
Comment