QUOTE (lindem)
Hi Folks!
Does anybody know how I can create a page that redirect the visitor to his language page?
If language is the issue and not necessarily country location, then a simple javascript redirect in the page header would work. For example the one below from
JavaScript Kit. This way the users browser language determines the language version of the site to send them to.
Configuration instructions are included in comments within script.
CODE
<script>
/*
Browser Language Redirect script- By JavaScript Kit
For this and over 400+ free scripts, visit [url="http://www.javascriptkit.com/"]http://www.javascriptkit.com[/url]
This notice must stay intact
*/
//Enter ISO 639-2 letter Language codes to detect (see: [url="http://www.w3.org/WAI/ER/IG/ert/iso639.htm"]http://www.w3.org/WAI/ER/IG/ert/iso639.htm[/url]):
var langcodes=new Array("en", "fr", "es", "ja", "zh", "default")
//Enter corresponding redirect URLs (last one is for default URL):
var langredirects=new Array("index.htm", "french.htm", "spanish.htm", "japan.htm", "chinese.htm", "index.htm")
var languageinfo=navigator.language? navigator.language : navigator.userLanguage
var gotodefault=1
function redirectpage(dest){
if (window.location.replace)
window.location.replace(dest)
else
window.location=dest
}
for (i=0;i<langcodes.length-1;i++){
if (languageinfo.substr(0,2)==langcodes[i]){
redirectpage(langredirects[i])
gotodefault=0
break
}
}
if (gotodefault)
redirectpage(langredirects[langcodes.length-1])
</script>