#Redirect to preffered locale

1 messages · Page 1 of 1 (latest)

frigid ingot
#

Hi, I need to make a redirect to the preferred language after entering the site for the first time, I have routing for the default language without the /en/ folder in the documentation it says to do just return Astro.redirect but with an example with two folders e.g.

/en/index
/pl/index
/index - and here redirect

And when I try to do without the folder for the default language, I get an empty page after changing the url

Also, I should probably add saving the user's chosen language to cookies? And then the first time they came to the site it should be taken from Astro.prefferedLanguage and the next times it should be taken from cookies?

frigid ingot
#

anyone have any idea? 😄

dull moss
#

Why do you prefer keeping the default language files in root instead of in specific language folder?

(For example it may be complicated to change default language later?)