My website is https://androidwedakarayo.com. Still, I am publishing articles in Sinhala, and near future, we hope to publish articles in English.
So I thought to add a language selector for the website as Sinhala and English and if someone selects Sinhala, he will redirect to androidwedakarayo.com/sinhala or someone selects English he will redirect to androidwedakarayo.com/english. And also if he comes back to the website he should redirect to the language page that he selected in the previous session.
You can create your own custom-home template that has the logic youâre looking for though you have to write custom code and then create new âhome-enâ and âhome-sinhalaâ. At least thatâs my suggestion.
Does anyone know how to do this but lead people to another site? When I send a post as a newsletter and recipient clicks âView Onlineâ I want them to go to my static Nextjs url, not the Ghost urlâŚ
I have tried using redirects.yaml and had trouble. Any help welcome.
Just I am looking for something handle by cookies. That means once you visited my website and selected Engish, it will store a cookie that you had selected Engish.
When you visit back to my website, it checks the locally stored cookie and redirects to the English content page.
I am not an expert with cookies and I am a beginner in web development. Therefore I need a guide.
Youâll have to do the work. There wonât be a guide thatâll be type this in your html doc to redirect for languages.
Hereâs how to set cookies in JS: JavaScript Cookies Then youâll need some custom code that checks for your cookie and on a particular value redirect.