Amazon S3 redirect based on browser language -
i've multi language website. want redirect english users /en , spanish users /es.
currently i'm doing via javascript, feel there better way.
<html> <body> <script type="text/javascript"> var language = window.navigator.userlanguage || window.navigator.language; if (["es","en"].indexof(language) != -1){ window.location.replace(language); } else{ // other languages go en window.location.replace("/en"); } </script> </body> </html>
Comments
Post a Comment