Redirecting Site Root URL to its Language Root Folder

582 Views Asked by At

Environment: Plone 4.3.4.1 , plone.app.multilingual 2.0.0 (from github)

I have two Plone sites, both with p.a.m enabled, but they behavior differently when visiting to their site root URL. Say, visit http://www.site1.com/ will redirect to http://www.site1.com/zh , that is what I need. But http://www.site2.com/ will show its item listing, that I want it redirect to http://www.site2.com/zh. See the below picture for reference.

Plone Root Folder

How do I enable the auto-redirection to one of its Language Root Folder? Hints are appreciated.

Edit After the Comment and Answer:

Ulrich and Mathias are right for the hints. Here are some more details. First, when I select "Chinese" as my default site language, there is no "Root language switcher" under "Display" menu.

Site Language

When I select "English" as my default site language, then I can see and select "Root language switcher" under "Display" menu. Everything works as expected.

Root Language Switcher

1

There are 1 best solutions below

0
On BEST ANSWER

It's like Ulrich mentioned, you can define the language-switcher View as default view on the plone root. This automatically redirects you to the desired language folder.

More Infos: https://github.com/plone/plone.app.multilingual/blob/2.x/src/plone/app/multilingual/browser/switcher.py

If you setup the a multilingual site, the default page of the plone root should be configured correctly: Check LanguageSetup: https://github.com/plone/plone.app.multilingual/blob/2.x/src/plone/app/multilingual/browser/setup.py#L245