I have a website that is available in multiple languages. Currently, the index.html file instantly redirects the user to the English homepage by using the line below:
<meta http-equiv="refresh" content="0; url=./en/home.html" />
However, I want it to instead check for the Browser language and do the following:
- If the browser language is French, redirect to the French homepage
- If the browser language is German, redirect to the German homepage
- If the browser language is Persian, redirect to the Persian homepage
- If the browser language is English or anything else, redirect to the English homepage.
Problem is, I have no idea how to do this, so I’d appreciate some help! And yes, I could technically replace the index.html with a manual language selector, bur for the sake of UX I want it to be automatic.
Also, I want to avoid using cookies if possible, as having to put a cookie popup on this site (which is meant to be a personal portfolio) ruins the intuitiveness.