Znalazłem taki skrypt js:
<script type="text/javascript">
var Destination = new Array(); // Leave line as is.
Destination["en-au"] = "http://www.willmaster.com/blog/au.html";
Destination["en-us"] = "http://www.willmaster.com/blog/us.html";
Destination["en"] = "http://www.willmaster.com/blog/english.html";
Destination["es"] = "http://www.willmaster.com/blog/spanish.html";
Destination["ru"] = "http://www.willmaster.com/blog/russian.html";
Destination["ar-sa"] = "http://www.willmaster.com/blog/saudi.html";
var DefaultDestination = "http://www.willmaster.com/";
var lang = navigator.language ? navigator.language :
navigator.browserlanguage ? navigator.browserlanguage :
navigator.systemLanguage ? navigator.systemLanguage :
navigator.userLanguage ? navigator.userLanguage :
'---';
lang = lang.toLowerCase();
var dest = new String();
for( var t in Destination ) {
if( t == lang ) {
dest = Destination[t];
break;
}
}
if( dest.length == 0 ) {
lang = lang.substr(0,2);
for( var t in Destination ) {
if( t == lang ) {
dest = Destination[t];
break;
}
}
}
if( dest.length == 0 ) { dest = DefaultDestination; }
if( dest.length > 0 ) { location.href = dest; }
</script>
Konfiguracja chyba dość intuicyjna ;)