I found this in a folder of web clippings that I keep.
I haven't tried it myself. It looks like PHP code to me so I would guess that the page needs the php extension.
<?
$user_lan = $HTTP_ACCEPT_LANGUAGE;
/******
language code | language
------------------------------------
ar | Arabic
cs | Czech
da | Danish
de | German
el | Greek
en | English
es | Spanish
fi | Finnish
fr | French
hu | Hungarian
it | Italian
jp | Japanese
nl | Dutch
no | Norwegian
pl | Polish
pt | Portuguese
ro | Romanian
ru | Russian
sr | (Latin) Serbian
sv | Swedish
th | Thai
tr | Turkish
zh | simplified Chinese
zh-tw | traditional Chinese
*********/
if($user_lan=='fr') {
## French
$redir_url = "http://www.frenchsponsor.com";
} elseif($user_lan=='es') {
## Spanish
$redir_url = "http://www.spanishsponsor.com";
} elseif($user_lan=='de') {
## German
$redir_url = "http://www.germansponsor.com";
} elseif($user_lan=='it') {
## Italian
$redir_url = "http://www.italiansponsor.com";
} elseif($user_lan=='ar') {
## Other Non-Us Languages
$redir_url = "http://www.othersponsor.com";
## US traffic or Rest of world not defined above
} else {
$redir_url = "http://www.yourmainurl.com";
}
header("Location: $redir_url");
exit;
?>
EXPLAINING THE ABOVE
I listed as many country codes as I could but I left out a few that I couldn't
find. I know UK is not on there but I believe that one to be 'en-uk'...Anyway
basically you can redirect surfers from ANY country to the URL of your choice,
and just let the US surfers through to your webpages.
|